加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
let path = require('path')
const ThemeColorReplacer = require('webpack-theme-color-replacer')
const {getThemeColors, changeSelector} = require('./src/utils/themeUtil')
const themeColor = require('./src/config').themeColor
module.exports = {
// transpileDependencies: ['webpack-theme-color-replacer'],
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [path.resolve(__dirname, "./src/theme/theme.less")],
}
},
configureWebpack: config => {
config.entry.app = ["babel-polyfill", "whatwg-fetch", "./src/main.js"];
config.plugins.push(
new ThemeColorReplacer({
fileName: 'css/theme-colors.css',
matchColors: getThemeColors(themeColor),
changeSelector
})
)
},
css: {
loaderOptions: {
less: {
lessOptions: {
modifyVars: {
// 'link-color': '#ff4d85',
// 'processing-color': '#ff4d85',
// 'primary-color': '#ff4d85',
// 'primary': '#1890ff',
},
javascriptEnabled: true
}
}
}
},
publicPath: './',
outputDir: 'dist',
assetsDir: 'static',
productionSourceMap: false
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化