Open JimiC opened 7 years ago
+1 same here. After switching module to index.es5 it works
+1 Anything new on this issue?
:+1: I've set the "module" property in package.json to "index.es5" and it doesn't work. @JimiC : Can you show me you package.json please ?
@mleprince You need to set this project's package.json
module
property to index.es5
.
In my case webpack is failing on Uglify
step as UglifyJS doesn't support es6
syntax. Should be similar reasons for others.
Take a look at the dygraphs-es6 repo. It includes examples of bundling dygraphs with webpack and rollup.
@danvk Excuse but the topic here isn't the use with webpack directly but the issue we have when using it with Angular which uses webpack (note here that Angular doesn't provide the ability to configure webpack). I would really appreciate if you take the time and examine my proposal.
If you can make that change without breaking the dygraphs-es6 repo, I'd be happy to consider it.
When I was setting up the dygraphs package.json
(#815) I used modules like d3-scale as a template. Its module
property points at a file which uses ES6 imports. If it works with Angular, I'd be curious to know what the difference between the two is.
@danvk I know now more about the module
property than I wanted. As I suspected changing that property's value is not a viable solution. I'll investigate this further.
This issue is related to https://github.com/mishoo/UglifyJS2/issues/448
@JimiC I agree. A workaround if anyone wants to use the es6 version.
I'm using
dygraphs
on an Angular 2 project viaangular-cli
. When I try to bundle the project for production (it useswebpack
), the bundling fails cause it tries to bundle thees6
version.I found out that if I change in the
package.json
themodule
property toindex.es5
everything is fine. I would have submitted a PR with this change but I'm not sure if this will break things for others.Please advise.