blutorange / closure-compiler-maven-plugin

Combine and minimize JavaScript with Closure Compiler.
http://blutorange.github.com/closure-compiler-maven-plugin
Apache License 2.0
52 stars 6 forks source link

Allow new feature --allow_dynamic_import released in last v20210202 #57

Closed juanrodicio closed 3 years ago

juanrodicio commented 3 years ago

Is there a way to allow this new feature? I'm working on a project when we use dynamic imports and until now we just replace all dynamic imports with a keyword that the closure compiler doesn't change, minify it and then we change it to import again.

This new flag will be very useful.

Thanks!

blutorange commented 3 years ago

I'll have to take a look at the flag if it requires any special treatment, but it's probably not a problem to add it. On side note: There's lots of special flag in closure compiler and I don't just want to expose them all, but I'll add them once somebody needs it. I'll take a look at it this weekend and let you know.

blutorange commented 3 years ago

Before implementing this I thought I'd update closure compiler to the recent version. As I was reading the changelog, I saw they added a flag for dynamic import expressions and thought, that sounds useful, let's add that. Then I came back to this issue and noticed this is what you thought as well : )

I've released version 2.21.0. Usage should be straight-forward, but you can see this test for an example: https://github.com/blutorange/closure-compiler-maven-plugin/blob/master/src/test/resources/projects/allowdynamicimport/pom.xml

juanrodicio commented 3 years ago

Thank you so much! You save my day :)