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

Bug: bundler is resolving babel options from node_modules package.json #778

Closed
nehaleem opened this issue Feb 9, 2018 · 2 comments
Closed

Comments

@nehaleem
Copy link

nehaleem commented Feb 9, 2018

Hi,

i tried to install module cancelable-promise and this package has inside its own package.json babel definition:

"babel": {
    "presets": [
      "es2015"
    ]
},

But, this module main is linked to dist/CancelablePromise.js, which is already transpiled.

Problem is that parcel bundler wants es2015 because its found it inside this package.json.

import CancelablePromise from 'cancelable-promise';

F:\project\node_modules\cancelable-promise\dist\CancelablePromise.js: Couldn't find preset "es2015" relative to directory "F:\\project
    at F:\project\node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (F:\project\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
    at OptionManager.mergePresets (F:\project\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
    at OptionManager.mergeOptions (F:\project\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
    at OptionManager.init (F:\project\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
    at File.initOptions (F:\project\node_modules\babel-core\lib\transformation\file\index.js:212:65)
    at new File (F:\project\node_modules\babel-core\lib\transformation\file\index.js:135:24)
    at JSAsset.getParserOptions (F:\project\node_modules\parcel-bundler\src\assets\JSAsset.js:71:20)
    at JSAsset.parse (F:\project\node_modules\parcel-bundler\src\assets\JSAsset.js:79:32)

and i dont need to have es2015.

When ill delete these line inside theirs package.json, its working.

@tifosiblack
Copy link

I would also like to add that it also seems to take .babelrc file from external modules (inside node_modules).

@lbguilherme
Copy link
Contributor

This was probably fixed by #559. Could you try with the version from master?

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

4 participants