报错: error in ./~/muse-ui/src/appBar/appBar.vue
Module build failed: variable @museUiTheme is undefined
@ D:DevelopmentCodevue-museUInode_modulesmuse-uisrcstylesimport.less (li
ne 1, column 8)
near lines:
@import "@{museUiTheme}";
@import "./mixins.less";
解决方法:
这个目录是你要找的路径:路径不能写错
build/vue-loader.conf.js代码:
var utils = require('./utils') var config = require('../config') var isProduction = process.env.NODE_ENV === 'production' const path = require('path') const museUiThemePath = path.join( __dirname, '..', 'node_modules', 'muse-ui', 'src/styles/themes/variables/default.less' ) var a = utils.cssLoaders({ sourceMap: isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap, extract: isProduction }) a.less = [ 'vue-style-loader', 'css-loader', { loader: 'less-loader', options: { globalVars: { museUiTheme: `'${museUiThemePath}'`, } } } ] module.exports = { loaders: a } // module.exports = { // loaders: utils.cssLoaders({ // sourceMap: isProduction // ? config.build.productionSourceMap // : config.dev.cssSourceMap, // extract: isProduction // }), postcss: [ require('autoprefixer')({ browsers: ['last 20 versions'] }) ] //}