@eighty4/dank 0.0.4-1 → 0.0.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/esbuild.js +1 -91
- package/lib/bin.ts +1 -1
- package/lib/build.ts +2 -4
- package/lib/config.ts +211 -5
- package/lib/dank.ts +14 -150
- package/lib/developer.ts +117 -0
- package/lib/flags.ts +1 -1
- package/lib/serve.ts +93 -10
- package/lib_js/bin.js +80 -84
- package/lib_js/build.js +72 -81
- package/lib_js/build_tag.js +20 -21
- package/lib_js/config.js +158 -18
- package/lib_js/dank.js +5 -122
- package/lib_js/define.js +8 -5
- package/lib_js/esbuild.js +156 -166
- package/lib_js/flags.js +115 -119
- package/lib_js/html.js +214 -228
- package/lib_js/http.js +174 -193
- package/lib_js/metadata.js +181 -201
- package/lib_js/public.js +45 -46
- package/lib_js/serve.js +212 -230
- package/lib_js/services.js +152 -171
- package/lib_types/dank.d.ts +8 -1
- package/package.json +5 -1
package/lib_js/esbuild.js
CHANGED
|
@@ -1,186 +1,176 @@
|
|
|
1
|
-
import { readFile } from
|
|
2
|
-
import esbuild, {} from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import esbuild, {} from "esbuild";
|
|
3
|
+
async function esbuildDevContext(b, r, define, entryPoints, c) {
|
|
4
|
+
return await esbuild.context({
|
|
5
|
+
define,
|
|
6
|
+
entryNames: "[dir]/[name]",
|
|
7
|
+
entryPoints: mapEntryPointPaths(entryPoints),
|
|
8
|
+
outdir: b.dirs.buildWatch,
|
|
9
|
+
...commonBuildOptions(b, r, c),
|
|
10
|
+
splitting: false,
|
|
11
|
+
write: false
|
|
12
|
+
});
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
14
|
+
async function esbuildWebpages(b, r, define, entryPoints, c) {
|
|
15
|
+
try {
|
|
16
|
+
await esbuild.build({
|
|
17
|
+
define,
|
|
18
|
+
entryNames: "[dir]/[name]-[hash]",
|
|
19
|
+
entryPoints: mapEntryPointPaths(entryPoints),
|
|
20
|
+
outdir: b.dirs.buildDist,
|
|
21
|
+
...commonBuildOptions(b, r, c)
|
|
22
|
+
});
|
|
23
|
+
} catch (ignore) {
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
27
|
+
async function esbuildWorkers(b, r, define, entryPoints, c) {
|
|
28
|
+
try {
|
|
29
|
+
await esbuild.build({
|
|
30
|
+
define,
|
|
31
|
+
entryNames: "[dir]/[name]-[hash]",
|
|
32
|
+
entryPoints: mapEntryPointPaths(entryPoints),
|
|
33
|
+
outdir: b.dirs.buildDist,
|
|
34
|
+
...commonBuildOptions(b, r, c),
|
|
35
|
+
splitting: false,
|
|
36
|
+
metafile: true,
|
|
37
|
+
write: true,
|
|
38
|
+
assetNames: "assets/[name]-[hash]"
|
|
39
|
+
});
|
|
40
|
+
} catch (ignore) {
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
45
43
|
}
|
|
46
44
|
function commonBuildOptions(b, r, c) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
const p = workersPlugin(r.buildRegistry());
|
|
46
|
+
return {
|
|
47
|
+
absWorkingDir: b.dirs.projectRootAbs,
|
|
48
|
+
assetNames: "assets/[name]-[hash]",
|
|
49
|
+
bundle: true,
|
|
50
|
+
format: "esm",
|
|
51
|
+
loader: c?.loaders || defaultLoaders(),
|
|
52
|
+
metafile: true,
|
|
53
|
+
minify: b.minify,
|
|
54
|
+
platform: "browser",
|
|
55
|
+
plugins: c?.plugins?.length ? [p, ...c.plugins] : [p],
|
|
56
|
+
splitting: true,
|
|
57
|
+
treeShaking: true,
|
|
58
|
+
write: true
|
|
59
|
+
};
|
|
62
60
|
}
|
|
63
61
|
function defaultLoaders() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
return {
|
|
63
|
+
".woff": "file",
|
|
64
|
+
".woff2": "file"
|
|
65
|
+
};
|
|
68
66
|
}
|
|
69
|
-
// esbuild will append the .js or .css to output filenames
|
|
70
|
-
// keeping extension on entryPoints data for consistency
|
|
71
|
-
// and only trimming when creating esbuild opts
|
|
72
67
|
function mapEntryPointPaths(entryPoints) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
return entryPoints.map((entryPoint) => {
|
|
69
|
+
return {
|
|
70
|
+
in: entryPoint.in,
|
|
71
|
+
out: entryPoint.out.replace(/\.(tsx?|jsx?|css)$/, "")
|
|
72
|
+
};
|
|
73
|
+
});
|
|
79
74
|
}
|
|
80
75
|
const WORKER_CTOR_REGEX = /new(?:\s|\r?\n)+(?<ctor>(?:Shared)?Worker)(?:\s|\r?\n)*\((?:\s|\r?\n)*(?<url>.*?)(?:\s|\r?\n)*(?<end>[\),])/g;
|
|
81
76
|
const WORKER_URL_REGEX = /^('.*'|".*")$/;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const loader = args.path.endsWith('ts') ? 'ts' : 'js';
|
|
136
|
-
return { contents, errors, loader };
|
|
137
|
-
});
|
|
138
|
-
build.onEnd((result) => {
|
|
139
|
-
if (result.metafile) {
|
|
140
|
-
r.completeBuild(result);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
};
|
|
77
|
+
function workersPlugin(r) {
|
|
78
|
+
return {
|
|
79
|
+
name: "@eighty4/dank/esbuild/workers",
|
|
80
|
+
setup(build) {
|
|
81
|
+
if (!build.initialOptions.absWorkingDir)
|
|
82
|
+
throw TypeError("plugin requires absWorkingDir");
|
|
83
|
+
if (!build.initialOptions.metafile)
|
|
84
|
+
throw TypeError("plugin requires metafile");
|
|
85
|
+
const { absWorkingDir } = build.initialOptions;
|
|
86
|
+
build.onLoad({ filter: /\.(t|m?j)s$/ }, async (args) => {
|
|
87
|
+
let contents = await readFile(args.path, "utf8");
|
|
88
|
+
let offset = 0;
|
|
89
|
+
let errors = void 0;
|
|
90
|
+
for (const workerCtorMatch of contents.matchAll(WORKER_CTOR_REGEX)) {
|
|
91
|
+
if (!WORKER_URL_REGEX.test(workerCtorMatch.groups.url)) {
|
|
92
|
+
if (!errors)
|
|
93
|
+
errors = [];
|
|
94
|
+
errors.push(invalidWorkerUrlCtorArg(locationFromMatch(args, contents, workerCtorMatch), workerCtorMatch));
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (isIndexCommented(contents, workerCtorMatch.index)) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const clientScript = args.path.replace(absWorkingDir, "").substring(1);
|
|
101
|
+
const workerUrl = workerCtorMatch.groups.url.substring(1, workerCtorMatch.groups.url.length - 1);
|
|
102
|
+
const workerEntryPoint = r.resolver.resolveHrefInPagesDir(clientScript, workerUrl);
|
|
103
|
+
if (workerEntryPoint === "outofbounds") {
|
|
104
|
+
if (!errors)
|
|
105
|
+
errors = [];
|
|
106
|
+
errors.push(outofboundsWorkerUrlCtorArg(locationFromMatch(args, contents, workerCtorMatch), workerCtorMatch));
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const workerUrlPlaceholder = workerEntryPoint.replace(/^pages/, "").replace(/\.(t|m?j)s$/, ".js");
|
|
110
|
+
const workerCtorReplacement = `new ${workerCtorMatch.groups.ctor}('${workerUrlPlaceholder}'${workerCtorMatch.groups.end}`;
|
|
111
|
+
contents = contents.substring(0, workerCtorMatch.index + offset) + workerCtorReplacement + contents.substring(workerCtorMatch.index + workerCtorMatch[0].length + offset);
|
|
112
|
+
offset += workerCtorReplacement.length - workerCtorMatch[0].length;
|
|
113
|
+
r.addWorker({
|
|
114
|
+
clientScript,
|
|
115
|
+
workerEntryPoint,
|
|
116
|
+
workerUrl,
|
|
117
|
+
workerUrlPlaceholder
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const loader = args.path.endsWith("ts") ? "ts" : "js";
|
|
121
|
+
return { contents, errors, loader };
|
|
122
|
+
});
|
|
123
|
+
build.onEnd((result) => {
|
|
124
|
+
if (result.metafile) {
|
|
125
|
+
r.completeBuild(result);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
145
130
|
}
|
|
146
131
|
function isIndexCommented(contents, index) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return blockCommented;
|
|
132
|
+
const preamble = contents.substring(0, index);
|
|
133
|
+
const lineIndex = preamble.lastIndexOf("\n") || 0;
|
|
134
|
+
const lineCommented = /\/\//.test(preamble.substring(lineIndex));
|
|
135
|
+
if (lineCommented) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
const blockCommentIndex = preamble.lastIndexOf("/*");
|
|
139
|
+
const blockCommented = blockCommentIndex !== -1 && preamble.substring(blockCommentIndex).indexOf("*/") === -1;
|
|
140
|
+
return blockCommented;
|
|
157
141
|
}
|
|
158
142
|
function locationFromMatch(args, contents, match) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
143
|
+
const preamble = contents.substring(0, match.index);
|
|
144
|
+
const line = preamble.match(/\n/g)?.length || 0;
|
|
145
|
+
let lineIndex = preamble.lastIndexOf("\n");
|
|
146
|
+
lineIndex = lineIndex === -1 ? 0 : lineIndex + 1;
|
|
147
|
+
const column = preamble.length - lineIndex;
|
|
148
|
+
const lineText = contents.substring(lineIndex, contents.indexOf("\n", lineIndex) || contents.length);
|
|
149
|
+
return {
|
|
150
|
+
lineText,
|
|
151
|
+
line,
|
|
152
|
+
column,
|
|
153
|
+
file: args.path,
|
|
154
|
+
length: match[0].length
|
|
155
|
+
};
|
|
172
156
|
}
|
|
173
157
|
function outofboundsWorkerUrlCtorArg(location, workerCtorMatch) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
158
|
+
return {
|
|
159
|
+
id: "worker-url-outofbounds",
|
|
160
|
+
text: `The ${workerCtorMatch.groups.ctor} constructor URL arg \`${workerCtorMatch.groups.url}\` cannot resolve to a path outside of the pages directory`,
|
|
161
|
+
location
|
|
162
|
+
};
|
|
179
163
|
}
|
|
180
164
|
function invalidWorkerUrlCtorArg(location, workerCtorMatch) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
165
|
+
return {
|
|
166
|
+
id: "worker-url-unresolvable",
|
|
167
|
+
text: `The ${workerCtorMatch.groups.ctor} constructor URL arg \`${workerCtorMatch.groups.url}\` must be a relative module path`,
|
|
168
|
+
location
|
|
169
|
+
};
|
|
186
170
|
}
|
|
171
|
+
export {
|
|
172
|
+
esbuildDevContext,
|
|
173
|
+
esbuildWebpages,
|
|
174
|
+
esbuildWorkers,
|
|
175
|
+
workersPlugin
|
|
176
|
+
};
|
package/lib_js/flags.js
CHANGED
|
@@ -1,128 +1,124 @@
|
|
|
1
|
-
import { join, resolve } from
|
|
2
|
-
import { cwd } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { join, resolve } from "node:path";
|
|
2
|
+
import { cwd } from "node:process";
|
|
3
|
+
function resolveBuildFlags() {
|
|
4
|
+
const flags = {
|
|
5
|
+
dirs: defaultProjectDirs(cwd()),
|
|
6
|
+
minify: willMinify(),
|
|
7
|
+
production: isProductionBuild()
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
get dirs() {
|
|
11
|
+
return flags.dirs;
|
|
12
|
+
},
|
|
13
|
+
get minify() {
|
|
14
|
+
return flags.minify;
|
|
15
|
+
},
|
|
16
|
+
get production() {
|
|
17
|
+
return flags.production;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
21
|
+
function resolveServeFlags(c) {
|
|
22
|
+
const preview = isPreviewBuild();
|
|
23
|
+
const flags = {
|
|
24
|
+
dirs: defaultProjectDirs(cwd()),
|
|
25
|
+
dankPort: dankPort(c, preview),
|
|
26
|
+
esbuildPort: esbuildPort(c),
|
|
27
|
+
logHttp: willLogHttp(),
|
|
28
|
+
minify: willMinify(),
|
|
29
|
+
preview,
|
|
30
|
+
production: isProductionBuild()
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
get dirs() {
|
|
34
|
+
return flags.dirs;
|
|
35
|
+
},
|
|
36
|
+
get dankPort() {
|
|
37
|
+
return flags.dankPort;
|
|
38
|
+
},
|
|
39
|
+
get esbuildPort() {
|
|
40
|
+
return flags.esbuildPort;
|
|
41
|
+
},
|
|
42
|
+
get logHttp() {
|
|
43
|
+
return flags.logHttp;
|
|
44
|
+
},
|
|
45
|
+
get minify() {
|
|
46
|
+
return flags.minify;
|
|
47
|
+
},
|
|
48
|
+
get preview() {
|
|
49
|
+
return flags.preview;
|
|
50
|
+
},
|
|
51
|
+
get production() {
|
|
52
|
+
return flags.production;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
// `dank build` will minify sources and append git release tag to build tag
|
|
59
|
-
// `dank serve` will pre-bundle with service worker and minify
|
|
60
|
-
const isProductionBuild = () => process.env.PRODUCTION === 'true' || process.argv.includes('--production');
|
|
61
|
-
// `dank serve` dank port for frontend webserver
|
|
62
|
-
// alternate --preview port for service worker builds
|
|
56
|
+
const isPreviewBuild = () => process.env.PREVIEW === "true" || process.argv.includes("--preview");
|
|
57
|
+
const isProductionBuild = () => process.env.PRODUCTION === "true" || process.argv.includes("--production");
|
|
63
58
|
function dankPort(c, preview) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
if (process.env.DANK_PORT?.length) {
|
|
60
|
+
return parsePortEnvVar("DANK_PORT");
|
|
61
|
+
}
|
|
62
|
+
return preview ? c.previewPort || c.port || 4e3 : c.port || 3e3;
|
|
68
63
|
}
|
|
69
|
-
// `dank serve` esbuild port for bundler integration
|
|
70
64
|
function esbuildPort(c) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
if (process.env.ESBUILD_PORT?.length) {
|
|
66
|
+
return parsePortEnvVar("ESBUILD_PORT");
|
|
67
|
+
}
|
|
68
|
+
return c.esbuild?.port || 3995;
|
|
75
69
|
}
|
|
76
70
|
function parsePortEnvVar(name) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
71
|
+
const port = parseInt(process.env[name], 10);
|
|
72
|
+
if (isNaN(port)) {
|
|
73
|
+
throw Error(`env var ${name}=${port} must be a valid port number`);
|
|
74
|
+
} else {
|
|
75
|
+
return port;
|
|
76
|
+
}
|
|
84
77
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
78
|
+
function defaultProjectDirs(projectRootAbs) {
|
|
79
|
+
const pages = "pages";
|
|
80
|
+
const dirs = {
|
|
81
|
+
buildRoot: "build",
|
|
82
|
+
buildDist: join("build", "dist"),
|
|
83
|
+
buildWatch: join("build", "watch"),
|
|
84
|
+
pages,
|
|
85
|
+
pagesResolved: resolve(join(projectRootAbs, pages)),
|
|
86
|
+
projectResolved: resolve(projectRootAbs),
|
|
87
|
+
projectRootAbs,
|
|
88
|
+
public: "public"
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
get buildRoot() {
|
|
92
|
+
return dirs.buildRoot;
|
|
93
|
+
},
|
|
94
|
+
get buildDist() {
|
|
95
|
+
return dirs.buildDist;
|
|
96
|
+
},
|
|
97
|
+
get buildWatch() {
|
|
98
|
+
return dirs.buildWatch;
|
|
99
|
+
},
|
|
100
|
+
get pages() {
|
|
101
|
+
return dirs.pages;
|
|
102
|
+
},
|
|
103
|
+
get pagesResolved() {
|
|
104
|
+
return dirs.pagesResolved;
|
|
105
|
+
},
|
|
106
|
+
get projectResolved() {
|
|
107
|
+
return dirs.projectResolved;
|
|
108
|
+
},
|
|
109
|
+
get projectRootAbs() {
|
|
110
|
+
return dirs.projectRootAbs;
|
|
111
|
+
},
|
|
112
|
+
get public() {
|
|
113
|
+
return dirs.public;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
123
116
|
}
|
|
124
|
-
const willMinify = () => isProductionBuild() ||
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
const willMinify = () => isProductionBuild() || process.env.MINIFY === "true" || process.argv.includes("--minify");
|
|
118
|
+
const willLogHttp = () => process.env.LOG_HTTP === "true" || process.argv.includes("--log-http");
|
|
119
|
+
export {
|
|
120
|
+
defaultProjectDirs,
|
|
121
|
+
isProductionBuild,
|
|
122
|
+
resolveBuildFlags,
|
|
123
|
+
resolveServeFlags
|
|
124
|
+
};
|