oligot / rollup-plugin-nodent

Rollup plugin for ES2017 async/await keywords
27 stars 2 forks source link

{sourceMap: false} option doesn't seem to persist when using rollup-watch #2

Closed nodefish closed 7 years ago

nodefish commented 7 years ago

Using a generic rollup config, with nodent({ sourceMap: false }) as one of the plugins, and running rollup -c -w (watch mode) causes the issue. The first build respects the setting, but any builds after the first generate inline sourceMaps.

oligot commented 7 years ago

Rollup doesn't generate source maps by default, so there is nothing to do (just call the nodent plugin without options).

If you want to generate source maps, you can do it by specifying the sourceMap: true option at the root level (as it is a global option that applies to all the plugins you use). I've updated the readme file to show how to do it.

nodefish commented 7 years ago

Thanks for responding.

I've already got sourceMap: false for rollup, and I'm usingnodent() without settings, and it works fine on the first build, but any subsequent builds triggered by saving a file (-w rollup flag) still seem to include inline sourcemaps (//# sourceMappingURL=data:application/json;charset=utf-8;base64,...) which bloat the output file size. Removing nodent() is the only thing that resolves the issue for me, or just running rollup -c each time rather than using watch mode.

oligot commented 7 years ago

Do you have a reproducible project that I can try out ? I've tried to reproduce your problem but it works, so I'm wondering what is different ?

nodefish commented 7 years ago

I'll make one ASAP and get back to you. Thanks.

nodefish commented 7 years ago

Managed to reproduce it: https://github.com/nodefish/rollup-plugin-nodent-issue-2

If you run rollup -c, the output will not include sourcemaps (correct behavior).

If you run rollup -c -w, the first output is correct, but then if you modify any files (say, src/index.js), a rebuild will be triggered: note that inline sourcemaps are included this time.

oligot commented 7 years ago

There was indeed a bug in the code. I've fixed it and released a new version 0.1.1. Can you try again with this version and tell me if this solves the problem ?

nodefish commented 7 years ago

Can confirm it works now, thanks!