My bundle is created correctly. The --global flag of babelify is the key here. It converts all es6 files in node_modules before adding them to the bundle.js.
When I run watchlify npx watchify src/index.js -o public/js/bundle.js fails with the following error
/home/me/AFolder/node_modules/@amcharts/amcharts5/index.js:1
export { Root } from "./.internal/core/Root";
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
The important thing in the package.json is the "browserify" object. Note that I declared the "global": true flag, although I know it has no effect. If I see the node_modules/babelify/index.js file I noticed that the "global" property is being removed.
How can I tell watchify to pass the global property to browserify/babelify?
Thanks
If I run this command in CLI everything works ok:
My bundle is created correctly. The --global flag of babelify is the key here. It converts all es6 files in node_modules before adding them to the bundle.js.
When I run watchlify
npx watchify src/index.js -o public/js/bundle.js
fails with the following errorMy package.json:
The important thing in the package.json is the "browserify" object. Note that I declared the "global": true flag, although I know it has no effect. If I see the node_modules/babelify/index.js file I noticed that the "global" property is being removed.
How can I tell watchify to pass the global property to browserify/babelify? Thanks