Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

liferay-npm-bundler fails when invoking babel if some preset plugins carry config options #59

Closed
izaera opened this issue Nov 10, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@izaera
Copy link
Member

izaera commented Nov 10, 2017

Some Babel presets provide plugins with configuration. In such cases liferay-npm-bundler fiddles with the configuration and ends up passing a wrong options object to babel.

That ends up in the following error being thrown:

Error: Plugin 1 specified in "base" provided an invalid property of "loose"
    at Plugin.init (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/babel-core/lib/t
ransformation/plugin.js:131:13)
    at Function.normalisePlugin (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/bab
el-core/lib/transformation/file/options/option-manager.js:152:12)
    at /Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/babel-core/lib/transformation
/file/options/option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/ba

bel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/b
abel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/babel-cor
e/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/babel-core/
lib/transformation/file/index.js:212:65)
    at new File (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/babel-core/lib/tran
sformation/file/index.js:135:24)
    at Pipeline.transform (/Users/ivan/Liferay/Javascript/liferay-npm-build-tools/packages/liferay-npm-bundler/node_modules/babel-cor
e/lib/transformation/pipeline.js:47:16)
@izaera izaera self-assigned this Nov 10, 2017
@izaera izaera added the bug label Nov 10, 2017
izaera pushed a commit to izaera/liferay-js-toolkit that referenced this issue Nov 10, 2017
@izaera izaera added this to the next version milestone Nov 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant