UNPKG

1.6 kBMarkdownView Raw
1# gcc-min
2Just 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
13In order to use gcc-min, please follow the steps as below:
14
15#### 1, Install and save gcc-min to devDependencies
16
17```
18npm 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
40So you can run the command to build:
41
42```
43npm run build
44```
45
46It will parse your package.json file, get the values in "gccmin" then build the module with these specified configurations.
47
48
49For better understanding, please refer [this live example](https://github.com/ndaidong/bellajs/blob/master/package.json).
50
51
52# Test
53
54```
55git clone https://github.com/ndaidong/gcc-min.git
56cd gcc-min
57npm install
58npm test
59```
60
61# License
62
63The MIT License (MIT)