admin管理员组文章数量:1435859
I am building an Angular app, and I use npm run ng serve
to build it. I use the latest Webpack 5+, and keep getting errors about my CSS files:
Build at: 2024-11-17T02:48:50.801Z - Hash: 99f74102247761e6 - Time: 19195ms
Warning: ▲ [WARNING] Comments in CSS use "/* ... */" instead of "//" [js-comment-in-css]
/Users/.../itemponent.scss:1:18:
1 │ /******/ (() => { // webpackBootstrap
My webpack.config.js
is quite short, and as far as I understand, should do the job:
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
module.exports = (config) => ({
...config,
target: 'electron-renderer',
plugins: [
...config.plugins,
new NodePolyfillPlugin({
excludeAliases: ["console"],
}),
],
module: {
rules: [
...config.module.rules,
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader',
],
},
],
},
});
Could have a misconfigured angular.json
or tsconfig.json
be the cause as well?
Any help is highly appreciated!
本文标签: Angular and Webpack keep throwing exception on invalid CSS comment syntaxStack Overflow
版权声明:本文标题:Angular and Webpack keep throwing exception on invalid CSS comment syntax - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745639917a2667790.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论