1 | import yargs from "yargs";
|
2 |
|
3 | import {
|
4 | create,
|
5 | } from "./index";
|
6 |
|
7 | const argv = yargs(process.argv.slice(2))
|
8 |
|
9 | .usage("Usage: $0 [options]")
|
10 |
|
11 | .example("webpack-browser-sync", "")
|
12 |
|
13 | .options({
|
14 | config: {
|
15 | description: "path to webpack.config",
|
16 | alias: "c",
|
17 | default: "./webpack.config.js",
|
18 | required: true,
|
19 | },
|
20 | webpack: {
|
21 | description: "enable webpack",
|
22 | type: "boolean",
|
23 | default: true,
|
24 | },
|
25 | index: {
|
26 | description: "index.html relative path from webpackConfig.output.path",
|
27 | type: "string",
|
28 | default: "index.html",
|
29 | },
|
30 | hot: {
|
31 | description: "enable hot module replacement [need enabled webpack]",
|
32 | type: "boolean",
|
33 | },
|
34 | proxy: {
|
35 | description: "use proxy for remote debug",
|
36 | type: "string",
|
37 | },
|
38 | compress: {
|
39 | description: "enable gzip",
|
40 | type: "boolean",
|
41 | },
|
42 | historyApiFallback: {
|
43 | description: "enable history api fallback",
|
44 | type: "boolean",
|
45 | },
|
46 | })
|
47 | .help("help")
|
48 | .alias("help", "h")
|
49 | .showHelpOnFail(false, "whoops, something went wrong! run with --help")
|
50 | .argv;
|
51 |
|
52 | create(argv as any);
|