Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决 @museUiTheme is undefined #1

Open
yuxianwen opened this issue Oct 12, 2017 · 1 comment
Open

解决 @museUiTheme is undefined #1

yuxianwen opened this issue Oct 12, 2017 · 1 comment

Comments

@yuxianwen
Copy link

刚好遇到这个问题

再网上找到方案限制公布出来

vue.loader.conf.js 改成如下:

`var utils = require('./utils')
var config = require('../config')
var isProduction = process.env.NODE_ENV === 'production'

// module.exports = {
// loaders: utils.cssLoaders({
// sourceMap: isProduction
// ? config.build.productionSourceMap
// : config.dev.cssSourceMap,
// extract: isProduction
// }),
// transformToRequire: {
// video: 'src',
// source: 'src',
// img: 'src',
// image: 'xlink:href'
// }
// }
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']
})
]
//}
`

@ElderJames
Copy link
Owner

谢谢,我晚点会尝试重现并修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants