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

Multiple module with babel-plugin-component: #1603

Closed
yoyo837 opened this issue Sep 7, 2017 · 12 comments
Closed

Multiple module with babel-plugin-component: #1603

yoyo837 opened this issue Sep 7, 2017 · 12 comments

Comments

@yoyo837
Copy link

yoyo837 commented Sep 7, 2017

#1356

build: {
    babel: {
      plugins: [
        ['component', [{
          libraryName: 'element-ui',
          styleLibraryName: 'theme-default'
        }, {
          libraryName: 'mint-ui',
          style: true
        }]]
      ]
    }
  }

However, it does not seem to support multiple module
babel-plugin-component#multiple-module

build: {
    babel: {
      plugins: [
        ['component', [{
          libraryName: 'element-ui',
          styleLibraryName: 'theme-default'
        }]]
      ]
    }
  }

and

build: {
    babel: {
      plugins: [
        ['component', {
          libraryName: 'element-ui',
          styleLibraryName: 'theme-default'
        }]
      ]
    }
  }

work fine!

This bug report is available on Nuxt.js community (#c1429)
@yoyo837
Copy link
Author

yoyo837 commented Sep 7, 2017

Old no-nuxt project work fine use this .babelrc file

{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"],
        "node": true
      }
    }],
    "stage-2"
  ],
  "plugins": [
    "transform-runtime", ["component", [{
      "libraryName": "element-ui",
      "styleLibraryName": "theme-default"
    }, {
      "libraryName": "mint-ui",
      "style": true
    }]]
  ],
  "env": {
    "test": {
      "presets": ["env", "stage-2"],
      "plugins": ["istanbul"]
    }
  }
}

@yuchonghua
Copy link

Look forward to more support
/ping @pimlie @alexchopin

@Atinux
Copy link
Member

Atinux commented Oct 28, 2017

Are you using the last version of Nuxt.js and babel-plugin-component?

@yoyo837
Copy link
Author

yoyo837 commented Oct 28, 2017

Yes,I' m sure.

@Atinux
Copy link
Member

Atinux commented Oct 28, 2017

Could you create a small reproduction repo so I can see where the problem is?

@yoyo837
Copy link
Author

yoyo837 commented Oct 28, 2017

There are some upstream new issues that need to be fixed at first.
ElementUI/babel-plugin-component#12
ElementUI/babel-plugin-component#14

repo: https://github.com/yoyo837/nuxt.js-issues-1603
branch: refactor-ui
code: /nuxt.config.js:line 77

@js-yezi
Copy link

js-yezi commented Oct 30, 2017

Look forward to more support
/ping @pimlie @alexchopin

@yuchonghua
Copy link

Look forward to more support
/ping @pimlie @alexchopin @QingWei-Li @Atinux

@mino01x
Copy link

mino01x commented Mar 28, 2018

I try this way

{
  "plugins": [xxx,
    ["component", {
      libraryName: "antd",
      style: true,
    }, "antd"],
    ["component", {
      libraryName: "test-module",
      style: true,
    }, "test-module"]
  ]
}

But it does not seem to support multiple module?
@yoyo837

@wusiquan
Copy link

依然存在此问题~

@stale
Copy link

stale bot commented Oct 31, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Oct 31, 2018
@stale stale bot closed this as completed Nov 7, 2018
@lock
Copy link

lock bot commented Dec 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 7, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants