vue-boilerplate-template
vue-boilerplate-template copied to clipboard
讲elementUi替换成vux之后项目编译不通过
check楼主的代码,讲elementUi替换成vux,移除elementui的引用和打包配置,加入vux之后打包会报以下
error in ./node_modules/vux/src/components/divider/index.vue
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <template>
| <p class="vux-divider">
| <slot></slot>
@ ./node_modules/happypack/loader.js?id=happy-babel-vue!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/test/getIcon.vue 2:0-59 11:13-20
@ ./src/test/getIcon.vue
@ ./src/router/routeConfig.js
@ ./src/router/index.js
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
error in ./node_modules/vux/src/components/popup/index.vue
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <template>
| <transition
| :name="`vux-popup-animate-${position}`">
相对你的配置差异部分如下
//webpack.base.conf.js
const vuxLoader = require('vux-loader')
module.exports = vuxLoader.merge(webpackConfig, {
plugins: [
'vux-ui',
'progress-bar',
{
name: 'duplicate-style',
options: {
cssProcessorOptions : {
safe: true,
zindex: false,
autoprefixer: {
add: true,
browsers: [
'iOS >= 7',
'Android >= 4.1'
]
}
}
}
}
]
//package.json
"vux-loader": "^1.2.9",
@snowlotus 抱歉才看到,请问上面所展示的 plugins 相关配置代码,是你现在修改后的全貌么?从报错看,是缺少了某个 loader 所导致的问题呢。