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

add-module-exports without es2015 preset #37

Open
pjasiun opened this issue Aug 11, 2016 · 1 comment
Open

add-module-exports without es2015 preset #37

pjasiun opened this issue Aug 11, 2016 · 1 comment

Comments

@pjasiun
Copy link

pjasiun commented Aug 11, 2016

I would like to keep ES6 code and transpile only modules loading, so do not add preset, but I add:

plugins: [ 'transform-es2015-modules-amd', 'add-module-exports' ]

For some reason, this plugin does not work in such configuration. It also does not work also even if I add all plugins from the es2015 preset, but without adding the preset.

Is it possible to make it works in such configuration?

@nerdgore
Copy link

This really is an issue for small modules in a ci environment as downloading plugins from npm takes up most of the time spent on building.

Contents of .babelrc:

{
  "plugins": [
    "add-module-exports",
    "transform-es2015-template-literals",
    "transform-es2015-modules-commonjs"
  ]
}

The thing is, it doesn't matter what you define in your .babelrc, as long as the es2015 preset is installed.

If I use the plugin in a similar fashion as described above I get the following error:

> babel lib/install-hooks.js -o dist/install-hooks.js

/usr/local/lib/node_modules/babel/lib/babel/util.js:55
      throw err;
      ^

TypeError: The plugin "add-module-exports" didn't export a Plugin instance
    at PluginManager.validate (/usr/local/lib/node_modules/babel/node_modules/babel-core/lib/transformation/file/plugin-manager.js:164:13)
    at PluginManager.add (/usr/local/lib/node_modules/babel/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
    at File.buildTransformers (/usr/local/lib/node_modules/babel/node_modules/babel-core/lib/transformation/file/index.js:240:21)
    at new File (/usr/local/lib/node_modules/babel/node_modules/babel-core/lib/transformation/file/index.js:140:10)
    at Pipeline.transform (/usr/local/lib/node_modules/babel/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at Object.exports.transform (/usr/local/lib/node_modules/babel/lib/babel/util.js:40:22)
    at Object.exports.compile (/usr/local/lib/node_modules/babel/lib/babel/util.js:49:20)
    at /usr/local/lib/node_modules/babel/lib/babel/file.js:123:23
    at arrayEach (/usr/local/lib/node_modules/babel/node_modules/lodash/index.js:1289:13)
    at Function.<anonymous> (/usr/local/lib/node_modules/babel/node_modules/lodash/index.js:3345:13)

@59naga 59naga added conflicts pure esmodules aka `{modules: false}` no transformation to commonjs need reproducible environment and removed conflicts pure esmodules aka `{modules: false}` no transformation to commonjs labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants