-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Open
Labels
needs reproductionThis issue is missing a minimal runnable reproduction, provided by the authorThis issue is missing a minimal runnable reproduction, provided by the author
Description
Version
4.4.6
Reproduction link
https://github.com/vuejs/vue-cli/issues
Environment info
Vue 2.6.1
node v14.14.0
操作系统:os window 都一样报错
Steps to reproduce
在执行npm run build 命令 提示 CSS minification error Expected a pseudo-class or pseudo-element 报错,打包失败。
在vue.config.js 中配置
css: {
requireModuleExtension: false,
sourceMap: true,
loaderOptions: {
scss: {
prependData: '@import "~@/styles/variables.scss";',
},
},
},
如果将css.scss 注释,将打包成功,但是项目使用的变量就报not found
我们的解决方案是 /node_modules/_@intervolga_optimize-cssnano-plugin@1.0.6@@intervolga/optimize-cssnano-plugin/index.js:107:21 去到当前文件 把throw Error 注释即可。
个人猜测是css optimizations 问题,可能是伪类或者伪元素使用不规范,但是没有找到官方的例子。
暂时还没有更好的解决方案。
What is expected?
npm run build 不报错,而不是去注释报错信息
What is actually happening?
npm run build 打包失败
Metadata
Metadata
Assignees
Labels
needs reproductionThis issue is missing a minimal runnable reproduction, provided by the authorThis issue is missing a minimal runnable reproduction, provided by the author