npm install
npm run serve
npm run build
npm run lint
1.vue.config.js配置css。loaderOptions报错@forward rules must be written before any other rules.或者@use rules must be written before any other rules.
- 原因:因为在main.ts中已经全局引入的css中 含有@use @forward等css注解。
- 解决办法:main.js全局引入同样改成配置
// vue.config.js
css: {
loaderOptions: {
scss: {
additionalData: '@import "~@/styles/element/index.scss";@import "~@/styles/variables.scss";'
}
}
}