Build: Fix pre release matching in compare size regex
[jquery.git] / build / command.js
blobaf172bace0a44a6c92df35bb33e07655e0fb7fa6
1 import yargs from "yargs/yargs";
2 import { build } from "./tasks/build.js";
3 import slimExclude from "./tasks/lib/slim-exclude.js";
5 const argv = yargs( process.argv.slice( 2 ) )
6         .version( false )
7         .command( {
8                 command: "[options]",
9                 describe: "Build a jQuery bundle"
10         } )
11         .option( "filename", {
12                 alias: "f",
13                 type: "string",
14                 description:
15                         "Set the filename of the built file. Defaults to jquery.js."
16         } )
17         .option( "dir", {
18                 alias: "d",
19                 type: "string",
20                 description:
21                         "Set the dir to which to output the built file. Defaults to /dist."
22         } )
23         .option( "version", {
24                 alias: "v",
25                 type: "string",
26                 description:
27                         "Set the version to include in the built file. " +
28                         "Defaults to the version in package.json plus the " +
29                         "short commit SHA and any excluded modules."
30         } )
31         .option( "watch", {
32                 alias: "w",
33                 type: "boolean",
34                 description:
35                         "Watch the source files and rebuild when they change."
36         } )
37         .option( "exclude", {
38                 alias: "e",
39                 type: "array",
40                 description:
41                         "Modules to exclude from the build. " +
42                         "Specifying this option will cause the " +
43                         "specified modules to be excluded from the build."
44         } )
45         .option( "include", {
46                 alias: "i",
47                 type: "array",
48                 description:
49                         "Modules to include in the build. " +
50                         "Specifying this option will override the " +
51                         "default included modules and only include these modules."
52         } )
53         .option( "esm", {
54                 type: "boolean",
55                 description:
56                         "Build an ES module (ESM) bundle. " +
57                         "By default, a UMD bundle is built."
58         } )
59         .option( "factory", {
60                 type: "boolean",
61                 description:
62                         "Build the factory bundle. " +
63                         "By default, a UMD bundle is built."
64         } )
65         .option( "slim", {
66                 alias: "s",
67                 type: "boolean",
68                 description: "Build a slim bundle, which excludes " +
69                         slimExclude.join( ", " )
70         } )
71         .option( "amd", {
72                 type: "string",
73                 description:
74                         "Set the name of the AMD module. Leave blank to make an anonymous module."
75         } )
76         .help()
77         .argv;
79 build( argv );