UNPKG

1.4 kBMarkdownView Raw
1# gcc-min
2Transpile 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```
14gccmin SOURCE_FILE OUTPUT_DIR EXPORT_NAME
15```
16
17Example:
18
19```
20sudo npm install -g gcc-min
21gccmin src/alpha.js dist alpha
22```
23
24It may be better for local usage:
25
26```
27npm install gcc-min --save-dev
28./node_modules/.bin/gccmin src/alpha.js dist alpha
29```
30
31You 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
40So you can run the command to minify:
41
42```
43npm run build
44```
45
46It will create folder "dist", and put 2 files alpha.js and alpha.min.js into there.
47
48
49# Test
50
51```
52git clone https://github.com/ndaidong/gcc-min.git
53cd gcc-min
54npm install
55npm test
56```
57
58# License
59
60The MIT License (MIT)