forked from patternfly/patternfly-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
executable file
·32 lines (25 loc) · 922 Bytes
/
build.js
File metadata and controls
executable file
·32 lines (25 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env node
import { fileURLToPath } from 'url';
import { join } from 'path';
import { pfeBuild } from '@patternfly/pfe-tools/esbuild.js';
import glob from 'glob';
import Yargs from 'yargs';
const { argv: { exclude, include, outdir, production, watch, workspace } } = Yargs(process.argv)
.options({
production: {
default: !!process.env.CI,
type: 'boolean',
conflicts: 'development',
},
exclude: { type: 'array' },
include: { type: 'array' },
workspace: { type: 'string' },
outdir: { type: 'string' },
watch: {
type: 'boolean',
}
});
const entryPointFilesExcludes = Array.isArray(exclude) ? exclude.map(x => glob(x, { cwd })) : undefined;
const mode = production ? 'production' : 'development';
const cwd = join(fileURLToPath(import.meta.url), '..', '..');
await pfeBuild({ cwd, entryPointFilesExcludes, include, mode, outdir, watch, workspace });