vue-template/vue.config.js

22 lines
697 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: true,
// 安装style-resources-loader
chainWebpack: (config) => {
const oneOfsMap = config.module.rule("stylus").oneOfs.store;
oneOfsMap.forEach(item => {
item
.use("style-resources-loader")
.loader("style-resources-loader")
.options({
// 这里的路径不能使用 @ 符号,否则会报错
patterns: ["./src/assets/styles/config.styl", "./src/assets/styles/palette.styl", "./src/assets/styles/theme.styl"]
// patterns: "./src/assets/reset.less"
})
.end()
})
}
});