1 | # webpack-production-builder
|
2 | At first I wanted to make it a 'webpack production builder'. But
|
3 | then, I decided to leave the compiling function to developers'
|
4 | local implementation so developers can use Webpack, rollup or anything else.
|
5 | In the end, this builder is just a minifying and uglification tool based on gulp.
|
6 |
|
7 | ## Install
|
8 | `npm install webpack-production-builder -g`
|
9 |
|
10 | ## CLI Command
|
11 | ### build
|
12 | `wpb -i input_path -o output_path`
|
13 |
|
14 | or
|
15 |
|
16 | `wpb --input input_path --output output_path`
|
17 |
|
18 | ### help
|
19 | `wpb -h`
|
20 |
|
21 | or
|
22 |
|
23 | `wpb --help`
|
24 |
|
25 | ### compile ignore
|
26 | Add a json file named `.staticignore.json` to the root directory of your code to configure compiling.
|
27 | Content of the file is like bellow:
|
28 |
|
29 | {
|
30 | "compileIgnore": [
|
31 | "**/*.min.js",
|
32 | "**/*.min.css"
|
33 | ],
|
34 | "completelyIgnore": [
|
35 | "src/**"
|
36 | ]
|
37 | }
|
38 |
|
39 | `compileIgnore` : files that match the rules will not be compiled, and will be in the output directory untouched specified by {{output_path}}.
|
40 | `completelyIgnore` : files that match it's rules will be removed completely from the output directory specified by {{output_path}}.
|
41 |
|
42 | ### Issues
|
43 | If you use react or ES2015, errors may be reported when compiling code
|
44 | with `wpb`. In this situation, you should install `babel-preset-react`
|
45 | or `babel-preset-es2015` in the parent or higher directory of the code
|
46 | file
|
47 |
|