1 | # gcc-min
|
2 | Transpile and Minify ECMAScript 6 using Google Closure Compiler.
|
3 |
|
4 | [![NPM](https://badge.fury.io/js/gcc-min.svg)](https://badge.fury.io/js/gcc-min)
|
5 | [![Build Status](https://travis-ci.org/ndaidong/gcc-min.svg?branch=master)](https://travis-ci.org/ndaidong/gcc-min)
|
6 | [![Coverage Status](https://coveralls.io/repos/github/ndaidong/gcc-min/badge.svg?branch=master)](https://coveralls.io/github/ndaidong/gcc-min?branch=master)
|
7 | [![Dependency Status](https://gemnasium.com/badges/github.com/ndaidong/gcc-min.svg)](https://gemnasium.com/github.com/ndaidong/gcc-min)
|
8 | [![Known Vulnerabilities](https://snyk.io/test/npm/gcc-min/badge.svg)](https://snyk.io/test/npm/gcc-min)
|
9 |
|
10 |
|
11 | # Usage
|
12 |
|
13 | ```
|
14 | gccmin SOURCE_FILE OUTPUT_DIR EXPORT_NAME
|
15 | ```
|
16 |
|
17 | Example:
|
18 |
|
19 | ```
|
20 | sudo npm install -g gcc-min
|
21 | gccmin src/alpha.js dist alpha
|
22 | ```
|
23 |
|
24 | It may be better for local usage:
|
25 |
|
26 | ```
|
27 | npm install gcc-min --save-dev
|
28 | ./node_modules/.bin/gccmin src/alpha.js dist alpha
|
29 | ```
|
30 |
|
31 | You can add the shortcut to package.json, in the "script" section:
|
32 |
|
33 | ```
|
34 | "scripts": {
|
35 | "test": "tape test/start.js | tap-spec",
|
36 | "build": "gccmin src/alpha.js dist alpha"
|
37 | },
|
38 | ```
|
39 |
|
40 | So you can run the command to minify:
|
41 |
|
42 | ```
|
43 | npm run build
|
44 | ```
|
45 |
|
46 | It will create folder "dist", and put 2 files alpha.js and alpha.min.js into there.
|
47 |
|
48 |
|
49 | # Test
|
50 |
|
51 | ```
|
52 | git clone https://github.com/ndaidong/gcc-min.git
|
53 | cd gcc-min
|
54 | npm install
|
55 | npm test
|
56 | ```
|
57 |
|
58 | # License
|
59 |
|
60 | The MIT License (MIT)
|