-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conditional compilation API via @define #26
Labels
enhancement
New feature or request
Comments
google/closure-compiler#1601 (comment)
|
theseanl
changed the title
Env variable support via module-level @define for closure compiler
API for module-level @define
Aug 12, 2019
theseanl
changed the title
API for module-level @define
Conditional compilation API for using @define
Aug 12, 2019
theseanl
changed the title
Conditional compilation API for using @define
Conditional compilation API via @define
Aug 12, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@define
in Closure compiler is like environment variables in other build tools. It is a common practice for webpack or rollup to access environment variables in source code (process.env.NODE_ENV
), so that the build tool replaces such expressions to a constant, and later a javascript minifier removes unvisited code blocks.In closure compiler, such a functionality is achieved via
@define
JsDoc annotation. Can we provide a uniform API for conditional compilation that uses@define
at closure compiler’s side and some custom plugin for rollup’s side?Currently there are some caveats of using
@define
ingoog.module
scopes, angular/tsickle#434. Since we control closure compiler flags as well, I think it would be possible to implement an easy API.The text was updated successfully, but these errors were encountered: