-
Notifications
You must be signed in to change notification settings - Fork 64
Does closure-compiler-js source map compatible with Rollup? #25
Comments
ccing @ChadKillingsworth in case he knows off the top of his head :) |
I'm guessing this is due to the fact that prior to this last month, Closure-compiler did not compose source maps. Changes are now merged to allow that, but it requires passing input sourcemaps to the compiler. For the Java version gulp plugin, I compose the sourcemap manually after compilation. See https://github.com/ChadKillingsworth/closure-compiler-npm/blob/c03707e59fb7da90ae910da7c02ea68b4030714f/lib/gulp/index.js#L177-L193 Other reasons might be due to the paths or the On a related note, I'd love for you to add your rollup plugin directly to the java version at https://github.com/ChadKillingsworth/closure-compiler-npm. I would definitely review and approve such a PR. I've found that developers wish to manage the compiler version directly, so it makes npm version management so much easier if the plugins are hosted in the same repo. |
@ChadKillingsworth @Dominator008 thanks for your help. I'm gonna digging into your code to understand the source maps composition. Once I've fixed the issue I would be happy to contribute to your project! |
I think closure-compiler works correctly. I would say that Rollup has a problem, but I am not 100% sure. |
Looking at the stack trace, it seems to be caused due to the fact that the source map sources array has no valid source files rollup can locate. My guess is that @samthor Thoughts on specifying the input filename for source maps? It could always be done post-processing too. |
I'm on my phone so I don't have the whole context. However, the generated On Mon., 26 Sep. 2016, 14:11 Chad Killingsworth, notifications@github.com
|
@samthor The issue is the input filename for the sources array - that's a little bit harder (though still doable): "sources":[" [synthetic:base] "," [synthetic:util/global] ","Input_0"] |
@ChadKillingsworth @samthor So far, in my tests, only es6 getters have produced this error in Rollup. |
I'm guessing it's caused due to the synthetic sources. You can try post processing the source map - specifically fill in the correct filename for the source I believe the issue comes from https://github.com/rollup/rollup/blob/c5d9d347721ad3d168b2ca6df27894be69815d1c/src/utils/collapseSourcemaps.js#L90 |
I'd like to replace the |
I try to write a Rollup plugin with closure-compiler-js: rollup-plugin-closure-compiler-js
It seems that source map generated by closure-compiler is not compatible with Rollup.
I reproduce the issue in an unit test
Here the link to the CI build
Should I transform the source map to make it compatible with Rollup? Or do I need to set specific options here?
The text was updated successfully, but these errors were encountered: