ElementUI / babel-plugin-component

Modular element-ui build plugin for babel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

presets {modules:false} 是否必选?

callmez opened this issue · comments

加上这个选项后和vue-cli的骨架设置冲突,去掉的话 在使用element-ui或mint-ui有无影响?

理论上不会有问题,有遇到啥 bug 么

加上 {modules:false}后会报错.

Module build failed: ReferenceError: [BABEL] /resources/src/main.js: Using removed Babel 5 option: foreign.modules - Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules

.babelrc

{
  "presets": ["es2015", "stage-2", {modules: false}],
  "plugins": ["transform-runtime", ["component", [
    {
      "libraryName": "element-ui",
      "styleLibraryName": "theme-default"
    },
    {
      "libraryName": "mint-ui",
      "style": true
    }
  ]]],
  "comments": false,
  "env": {
    "test": {
      "plugins": [ "istanbul" ]
    }
  }
}

是不是我设置有问题?

这个设置麻烦请在文档里说明下使用原因.感谢!

你自己的 babel 配置错了。 modules 是 es2015 的选项。请自己看 babel 的文档。

"stage-2"的设置? 去掉了还是报错. 文档也看了, 烦请指教谢谢.

就是这样配置的

{
  "presets": ["es2015", {"modules": false}],
  "plugins": ["transform-runtime", ["component", [
    {
      "libraryName": "element-ui",
      "styleLibraryName": "theme-default"
    },
    {
      "libraryName": "mint-ui",
      "style": true
    }
  ]]],
  "comments": false,
  "env": {
    "test": {
      "plugins": [ "istanbul" ]
    }
  }
}

还是一样的错误

麻烦仔细看文档,选项都写错地方了

看到了谢谢.....