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

讲elementUi替换成vux之后项目编译不通过 #15

Open
snowlotus opened this issue Feb 27, 2019 · 1 comment
Open

讲elementUi替换成vux之后项目编译不通过 #15

snowlotus opened this issue Feb 27, 2019 · 1 comment

Comments

@snowlotus
Copy link

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",
@nicejade
Copy link
Owner

@snowlotus 抱歉才看到,请问上面所展示的 plugins 相关配置代码,是你现在修改后的全貌么?从报错看,是缺少了某个 loader 所导致的问题呢。

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