1 | # gcc-min
|
2 | Just write scripts for Node.js environment, then build to use in the browsers.
|
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 | In order to use gcc-min, please follow the steps as below:
|
14 |
|
15 | #### 1, Install and save gcc-min to devDependencies
|
16 |
|
17 | ```
|
18 | npm install gcc-min --save-dev
|
19 | ```
|
20 |
|
21 | #### 2, Update package.json with *gccmin* property
|
22 |
|
23 | ```
|
24 | "gccmin": {
|
25 | "source": "PATH_TO_SOURCE_FILE",
|
26 | "target": "WHERE_TO_OUTPUT",
|
27 | "filename": "NAME_OF_OUTPUT_FILE",
|
28 | "globalVar": "GLOBAL_VAR_NAME"
|
29 | }
|
30 | ```
|
31 |
|
32 | #### 3, Add shortcut command to the "script" section
|
33 |
|
34 | ```
|
35 | "scripts": {
|
36 | "build": "gccmin"
|
37 | },
|
38 | ```
|
39 |
|
40 | So you can run the command to build:
|
41 |
|
42 | ```
|
43 | npm run build
|
44 | ```
|
45 |
|
46 | It will parse your package.json file, get the values in "gccmin" then build the module with these specified configurations.
|
47 |
|
48 |
|
49 | For better understanding, please refer [this live example](https://github.com/ndaidong/bellajs/blob/master/package.json).
|
50 |
|
51 |
|
52 | # Test
|
53 |
|
54 | ```
|
55 | git clone https://github.com/ndaidong/gcc-min.git
|
56 | cd gcc-min
|
57 | npm install
|
58 | npm test
|
59 | ```
|
60 |
|
61 | # License
|
62 |
|
63 | The MIT License (MIT)
|