Update babel and webpack
Closed this issue · 5 comments
Hi!
I want to update babel and webpack and i make commit with required changes https://github.com/andgrankin/react-bootstrap-modal/commit/f1ec81dc548e9c67308eb5364ffd7e44d970738b
Tests passed, but gulp transpile do not work because gulp-babel-helpers should be updated too then. Could you help to update both projects and do not break anything?)
BTW, i solved my problem with breakConfig option, and now i can use react-bootstrap-modal with my newer babel.
But my question still opened)
Sorry why do you need the dev deps updated? the current setup works and the are only for building so I don't feel a strong need to update them
In my project i use babel-loader version 5.3.2
in code i wrote:
var Modal = require('react-bootstrap-modal');
.....
when i try to build that code i got error
ERROR in ./~/react-bootstrap-modal/lib/Modal.js
Module build failed: ReferenceError: [BABEL] /path/to/project/node_modules/react-bootstrap-modal/lib/Modal.js: Unknown option: /path/to/project/node_modules/react-bootstrap-modal/package.json.playground
that happen because when babel compile file it try to load config for babel from package folder, but playground option deprecated since version 5.0
I found solution, i use breakConfig option, when it set to true babel skips configs from packages folders.
So babel with version > 5.0 will not transpile code which use your module if option breakConfig is not false.
you shouldn't be trying to build the react-bootstrap-modal code it is already transpiled. in your webpack config you should exclude node_modules
Thank you!