https://github.com/prashnts/closure-compiler-brunch
JavaScript optimization with Closure Compiler in JS for Brunch.
https://github.com/prashnts/closure-compiler-brunch
brunch closure-compiler optimization
Last synced: 9 months ago
JSON representation
JavaScript optimization with Closure Compiler in JS for Brunch.
- Host: GitHub
- URL: https://github.com/prashnts/closure-compiler-brunch
- Owner: prashnts
- License: mit
- Created: 2016-08-28T14:24:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-01-26T08:36:37.000Z (over 6 years ago)
- Last Synced: 2025-08-18T16:08:19.612Z (10 months ago)
- Topics: brunch, closure-compiler, optimization
- Language: CoffeeScript
- Homepage:
- Size: 271 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## closure-compiler-brunch
Adds [Closure Compiler JS](https://github.com/google/closure-compiler-js) support to [brunch](http://brunch.io).
The Closure Compiler tool can produce highly optimized JavaScript code by static analysis, dead code removal and minification.
This plugin leverages the JavaScript implementation of Closure Compiler, hence _Java is not required_.
[](https://travis-ci.org/prashnts/closure-compiler-brunch)
[](https://codeclimate.com/github/prashnts/closure-compiler-brunch/coverage)
[](https://greenkeeper.io/)
[](https://nodei.co/npm/closure-compiler-brunch/)
## Usage
Install the plugin via npm with:
```
npm install --save closure-compiler-brunch
```
**Important**: ES6 required. `node <= 4.X.X` not supported without `harmony` flag. See [node green](http://node.green/).
The optimizations are applied in production builds by default. You can supply `-p` flag with your build command.
Closure Compiler flags can be passed to the `compiler` via `config.plugins.closurecompiler` object, for example, the default flags are given below:
```coffeescript
config =
plugins:
closurecompiler:
compilationLevel: 'SIMPLE'
createSourceMap: yes
```
`compilationLevel` can either be `WHITESPACE_ONLY`, `SIMPLE`, or `ADVANCED`.
- [on npm](https://www.npmjs.com/package/closure-compiler-brunch)
- [on github](https://github.com/prashnts/closure-compiler-brunch)
## License
The MIT License (MIT)