Element: [Bug Report] Yarn build fails with babel-plugin-component

Created on 17 Jul 2018  ·  2Comments  ·  Source: ElemeFE/element

Element UI version

2.4.4

OS/Browsers version

Windows 10 / 67.0.3396.99

Vue version

2.5.16

Reproduction Link

https://github.com/lyzs90/element-ui-bug-repro

Steps to reproduce

Follow on demand import of Element components guide (http://element.eleme.io/#/en-US/component/quickstart) then run yarn build

What is Expected?

Build should be successful

What is actually happening?

Build fails with error: Plugin/Preset files are not allowed to export objects, only functions.

Most helpful comment

babel.config.js

module.exports = {
- presets: ['@vue/app', ['es2015', { modules: false }]],
+ presets: ['@vue/app'],
  plugins: [
    [
      'component',
      {
        libraryName: 'element-ui',
        styleLibraryName: 'theme-chalk'
      }
    ]
  ]
};

All 2 comments

babel.config.js

module.exports = {
- presets: ['@vue/app', ['es2015', { modules: false }]],
+ presets: ['@vue/app'],
  plugins: [
    [
      'component',
      {
        libraryName: 'element-ui',
        styleLibraryName: 'theme-chalk'
      }
    ]
  ]
};

This would be great to mention in the Quick Start.

Was this page helpful?
0 / 5 - 0 ratings