Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove exports before calling closure compiler #68

Merged
merged 3 commits into from
Sep 19, 2018

Conversation

kristoferbaxter
Copy link
Contributor

First take at resolving #56.

Having issues with npm linking locally, but this change removes all exports from source before Closure Compiler acts on the source. This prevents Closure Compiler from transpiling the export statements in some scenarios.

@kristoferbaxter
Copy link
Contributor Author

@TrySound and @Andarist – This branch introduces tests for the scenario in #56.

Important note: If any code remains that is not part of the ECMASCRIPT5_STRICT subset, then Closure Compiler will attempt to transpile it, and insert the boilerplate you saw earlier.

@kristoferbaxter kristoferbaxter merged commit 6069883 into master Sep 19, 2018
@kristoferbaxter kristoferbaxter deleted the remove-exports branch September 19, 2018 23:20
@Andarist
Copy link
Contributor

But if one targets newer subset they can just use the newer language_version without adding the boilerplate, right?

@kristoferbaxter
Copy link
Contributor Author

kristoferbaxter commented Sep 20, 2018

If targeting a newer subset, you can omit the language_out value (the default is NO_TRANSPILE in this plugin), or can set the value to a newer version like ECMASCRIPT_2015. This would avoid boilerplate, yes.

Visit https://github.com/google/closure-compiler/wiki/Flags-and-Options for possible output options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants