theme写在外部less中不生效
gitdogogo opened this issue · 1 comments
gitdogogo commented
我的vue.config.js
const path = require('path')
const theme = path.resolve(__dirname,'./src/theme/index.less')
console.log(theme)
module.exports = {
outputDir: 'dist',
publicPath: process.env.NODE_ENV === 'production' ? '/vant-demo/' : '/',
css: {
loaderOptions: {
less: {
modifyVars: {
hack: `true; @import "${theme}";`,
}
}
}
}
};
src/theme/index.less
@font-size-sm:'13px';
@font-size-md:'15px';
@font-size-lg:'17px';
@goods-action-button-danger-color:'#7232dd';
@goods-action-button-warning-color:'#3eaf7c';
gitdogogo commented
升级本地依赖成demo中的版本就可以了