1.main.js
import 'muse-components/styles/base.less'
2.utils.js
const museUiThemePath = path.join(
__dirname,
'..',
'node_modules',
'muse-ui',
'src/styles/themes/variables/default.less'
)
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less', {
globalVars: {
museUiTheme: `'${museUiThemePath}'`
}
}),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
3 webpack.base.config.js
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'@img': resolve('src/assets/img'),
'muse-components': 'muse-ui/src'
}
{
test: /muse-ui.src.*?js$/,
loader: 'babel-loader'
}
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../src/assets'),
'components': path.resolve(__dirname, '../src/components'),
'muse-components': 'muse-ui/src'
}
},