@modern-js/app-tools 2.17.1 → 2.18.1
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/CHANGELOG.md +56 -0
- package/dist/cjs/analyze/constants.js +2 -2
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +3 -4
- package/dist/cjs/initialize/index.js +2 -2
- package/dist/cjs/schema/index.js +2 -2
- package/dist/cjs/schema/legacy.js +7 -7
- package/dist/esm/analyze/constants.js +2 -2
- package/dist/esm/analyze/generateCode.js +28 -28
- package/dist/esm/analyze/getClientRoutes/getRoutes.js +9 -9
- package/dist/esm/analyze/getClientRoutes/getRoutesLegacy.js +9 -9
- package/dist/esm/analyze/getFileSystemEntry.js +6 -6
- package/dist/esm/analyze/getHtmlTemplate.js +2 -2
- package/dist/esm/analyze/getServerRoutes.js +4 -4
- package/dist/esm/analyze/index.js +18 -18
- package/dist/esm/analyze/nestedRoutes.js +3 -3
- package/dist/esm/analyze/templates.js +13 -22
- package/dist/esm/analyze/utils.js +1 -1
- package/dist/esm/builder/builder-rspack/adapterCopy.js +1 -1
- package/dist/esm/builder/builder-webpack/createCopyPattern.js +2 -2
- package/dist/esm/builder/builder-webpack/index.js +1 -1
- package/dist/esm/builder/generator/createBuilderOptions.js +1 -1
- package/dist/esm/builder/generator/createBuilderProviderConfig.js +1 -1
- package/dist/esm/builder/generator/index.js +1 -1
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +9 -9
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +5 -5
- package/dist/esm/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +1 -1
- package/dist/esm/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +1 -1
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +4 -5
- package/dist/esm/builder/shared/createCopyInfo.js +3 -3
- package/dist/esm/commands/build.js +3 -3
- package/dist/esm/commands/dev.js +8 -8
- package/dist/esm/commands/serve.js +3 -3
- package/dist/esm/config/default.js +7 -7
- package/dist/esm/config/initialize/inits.js +1 -1
- package/dist/esm/config/legacy/createHtmlConfig.js +13 -13
- package/dist/esm/config/legacy/createOutputConfig.js +15 -15
- package/dist/esm/config/legacy/createSourceConfig.js +9 -9
- package/dist/esm/config/legacy/createToolsConfig.js +14 -14
- package/dist/esm/config/legacy/index.js +14 -14
- package/dist/esm/defineConfig.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/initialize/index.js +8 -8
- package/dist/esm/schema/Schema.js +3 -3
- package/dist/esm/schema/index.js +2 -2
- package/dist/esm/schema/legacy.js +2 -2
- package/dist/esm/utils/config.js +2 -2
- package/dist/esm/utils/createServer.js +1 -1
- package/dist/esm/utils/getServerInternalPlugins.js +2 -2
- package/dist/esm-node/analyze/constants.js +2 -2
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +1 -2
- package/dist/esm-node/initialize/index.js +2 -2
- package/dist/esm-node/schema/index.js +1 -1
- package/dist/esm-node/schema/legacy.js +1 -1
- package/dist/types/analyze/constants.d.ts +2 -2
- package/package.json +24 -24
|
@@ -30,7 +30,7 @@ function _async_to_generator(fn) {
|
|
|
30
30
|
function _define_property(obj, key, value) {
|
|
31
31
|
if (key in obj) {
|
|
32
32
|
Object.defineProperty(obj, key, {
|
|
33
|
-
value,
|
|
33
|
+
value: value,
|
|
34
34
|
enumerable: true,
|
|
35
35
|
configurable: true,
|
|
36
36
|
writable: true
|
|
@@ -198,7 +198,7 @@ var createIndexRoute = function(routeInfo, rootDir, filename, entryName) {
|
|
|
198
198
|
var createRoute = function(routeInfo, rootDir, filename, entryName) {
|
|
199
199
|
var id = getRouteId(filename, rootDir, entryName);
|
|
200
200
|
return _object_spread_props(_object_spread({}, routeInfo), {
|
|
201
|
-
id,
|
|
201
|
+
id: id,
|
|
202
202
|
type: "nested"
|
|
203
203
|
});
|
|
204
204
|
};
|
|
@@ -245,7 +245,7 @@ export var walk = function() {
|
|
|
245
245
|
route = {
|
|
246
246
|
path: routePath === null || routePath === void 0 ? void 0 : routePath.replace(/\$$/, "?"),
|
|
247
247
|
children: [],
|
|
248
|
-
isRoot
|
|
248
|
+
isRoot: isRoot
|
|
249
249
|
};
|
|
250
250
|
pageLoaderFile = "";
|
|
251
251
|
pageRoute = null;
|
|
@@ -41,7 +41,7 @@ function _async_to_generator(fn) {
|
|
|
41
41
|
function _define_property(obj, key, value) {
|
|
42
42
|
if (key in obj) {
|
|
43
43
|
Object.defineProperty(obj, key, {
|
|
44
|
-
value,
|
|
44
|
+
value: value,
|
|
45
45
|
enumerable: true,
|
|
46
46
|
configurable: true,
|
|
47
47
|
writable: true
|
|
@@ -256,16 +256,7 @@ export var renderFunction = function(param) {
|
|
|
256
256
|
}).join("\n"), "\n ]\n })(").concat(fileSystemRoutes2 ? "" : "App", ")\n\n\n if(!AppWrapper.init && typeof appInit !== 'undefined') {\n AppWrapper.init = appInit;\n }\n\n\n if (IS_BROWSER) {\n ").concat(customBootstrap ? "customBootstrap(AppWrapper, () => ".concat(bootstrap, ");") : "".concat(bootstrap, ";"), "\n }\n\n return AppWrapper\n");
|
|
257
257
|
};
|
|
258
258
|
export var html = function(partials) {
|
|
259
|
-
return "\n<!DOCTYPE html>\n<html>\n<head>\n <%= meta %>\n <title><%= title %></title>\n\n ".concat(partials.top.join("\n"), "\n\n ").concat(partials.head.join("\n"),
|
|
260
|
-
|
|
261
|
-
</head>
|
|
262
|
-
|
|
263
|
-
<body>
|
|
264
|
-
<noscript>
|
|
265
|
-
We're sorry but react app doesn't work properly without JavaScript enabled. Please enable it to continue.
|
|
266
|
-
</noscript>
|
|
267
|
-
<div id="<%= mountId %>"><!--<?- html ?>--></div>
|
|
268
|
-
`).concat(partials.body.join("\n"), "\n <!--<?- chunksMap.js ?>-->\n <!--<?- SSRDataScript ?>-->\n <!--<?- bottomTemplate ?>-->\n</body>\n\n</html>\n");
|
|
259
|
+
return "\n<!DOCTYPE html>\n<html>\n<head>\n <%= meta %>\n <title><%= title %></title>\n\n ".concat(partials.top.join("\n"), "\n\n ").concat(partials.head.join("\n"), "\n\n</head>\n\n<body>\n <noscript>\n We're sorry but react app doesn't work properly without JavaScript enabled. Please enable it to continue.\n </noscript>\n <div id=\"<%= mountId %>\"><!--<?- html ?>--></div>\n ").concat(partials.body.join("\n"), "\n <!--<?- chunksMap.js ?>-->\n <!--<?- SSRDataScript ?>-->\n <!--<?- bottomTemplate ?>-->\n</body>\n\n</html>\n");
|
|
269
260
|
};
|
|
270
261
|
export var routesForServer = function(param) {
|
|
271
262
|
var routes = param.routes;
|
|
@@ -284,8 +275,8 @@ export var routesForServer = function(param) {
|
|
|
284
275
|
}
|
|
285
276
|
}
|
|
286
277
|
var finalRoute = _object_spread_props(_object_spread({}, route2), {
|
|
287
|
-
loader,
|
|
288
|
-
children
|
|
278
|
+
loader: loader,
|
|
279
|
+
children: children
|
|
289
280
|
});
|
|
290
281
|
return finalRoute;
|
|
291
282
|
};
|
|
@@ -396,10 +387,10 @@ export var fileSystemRoutes = function() {
|
|
|
396
387
|
rootLayoutCode = "import RootLayout from '".concat(route2._component, "'");
|
|
397
388
|
component2 = "RootLayout";
|
|
398
389
|
} else if (ssrMode === "string") {
|
|
399
|
-
lazyImport = '() => import(/* webpackChunkName: "'.concat(route2.id,
|
|
390
|
+
lazyImport = '() => import(/* webpackChunkName: "'.concat(route2.id, "\" */ '").concat(route2._component, "')");
|
|
400
391
|
component2 = "loadable(".concat(lazyImport, ")");
|
|
401
392
|
} else {
|
|
402
|
-
lazyImport = '() => import(/* webpackChunkName: "'.concat(route2.id,
|
|
393
|
+
lazyImport = '() => import(/* webpackChunkName: "'.concat(route2.id, "\" */ '").concat(route2._component, "')");
|
|
403
394
|
component2 = "lazy(".concat(lazyImport, ")");
|
|
404
395
|
}
|
|
405
396
|
} else {
|
|
@@ -417,12 +408,12 @@ export var fileSystemRoutes = function() {
|
|
|
417
408
|
}
|
|
418
409
|
}
|
|
419
410
|
var finalRoute2 = _object_spread_props(_object_spread({}, route2), {
|
|
420
|
-
lazyImport,
|
|
421
|
-
loading,
|
|
422
|
-
loader,
|
|
423
|
-
config,
|
|
424
|
-
error,
|
|
425
|
-
children
|
|
411
|
+
lazyImport: lazyImport,
|
|
412
|
+
loading: loading,
|
|
413
|
+
loader: loader,
|
|
414
|
+
config: config,
|
|
415
|
+
error: error,
|
|
416
|
+
children: children
|
|
426
417
|
});
|
|
427
418
|
if (route2._component) {
|
|
428
419
|
finalRoute2.component = component2;
|
|
@@ -453,7 +444,7 @@ export var fileSystemRoutes = function() {
|
|
|
453
444
|
} else {
|
|
454
445
|
component = "loadable(() => import('".concat(route._component, "'))");
|
|
455
446
|
finalRoute = _object_spread_props(_object_spread({}, route), {
|
|
456
|
-
component
|
|
447
|
+
component: component
|
|
457
448
|
});
|
|
458
449
|
keywords1 = [
|
|
459
450
|
"component",
|
|
@@ -12,7 +12,7 @@ var info = function(file) {
|
|
|
12
12
|
export function createPublicPattern(appContext, config, chain) {
|
|
13
13
|
var publicDir = createCopyInfo(appContext, config).publicDir;
|
|
14
14
|
return {
|
|
15
|
-
info,
|
|
15
|
+
info: info,
|
|
16
16
|
from: "**/*",
|
|
17
17
|
to: "public",
|
|
18
18
|
context: publicDir,
|
|
@@ -29,7 +29,7 @@ export function createPublicPattern(appContext, config, chain) {
|
|
|
29
29
|
export function createUploadPattern(appContext, config) {
|
|
30
30
|
var uploadDir = createCopyInfo(appContext, config).uploadDir;
|
|
31
31
|
return {
|
|
32
|
-
info,
|
|
32
|
+
info: info,
|
|
33
33
|
from: "**/*",
|
|
34
34
|
to: "upload",
|
|
35
35
|
context: uploadDir,
|
|
@@ -146,7 +146,7 @@ function _generateBuilder() {
|
|
|
146
146
|
_ref = utils || {}, modifyBuilderConfig = _ref.modifyBuilderConfig, modifyBuilderInstance = _ref.modifyBuilderInstance;
|
|
147
147
|
builderConfig = createBuilderProviderConfig(normalizedConfig, appContext, modifyBuilderConfig);
|
|
148
148
|
provider = generateProvider({
|
|
149
|
-
builderConfig
|
|
149
|
+
builderConfig: builderConfig
|
|
150
150
|
});
|
|
151
151
|
target = getBuilderTargets(normalizedConfig);
|
|
152
152
|
builderOptions = createBuilderOptions(target, appContext);
|
|
@@ -30,7 +30,7 @@ function _async_to_generator(fn) {
|
|
|
30
30
|
function _define_property(obj, key, value) {
|
|
31
31
|
if (key in obj) {
|
|
32
32
|
Object.defineProperty(obj, key, {
|
|
33
|
-
value,
|
|
33
|
+
value: value,
|
|
34
34
|
enumerable: true,
|
|
35
35
|
configurable: true,
|
|
36
36
|
writable: true
|
|
@@ -207,17 +207,17 @@ export var builderPluginAdapterHtml = function(options) {
|
|
|
207
207
|
2
|
|
208
208
|
];
|
|
209
209
|
applyBottomHtmlPlugin({
|
|
210
|
-
api,
|
|
211
|
-
options,
|
|
212
|
-
chain,
|
|
213
|
-
CHAIN_ID,
|
|
214
|
-
HtmlBundlerPlugin
|
|
210
|
+
api: api,
|
|
211
|
+
options: options,
|
|
212
|
+
chain: chain,
|
|
213
|
+
CHAIN_ID: CHAIN_ID,
|
|
214
|
+
HtmlBundlerPlugin: HtmlBundlerPlugin
|
|
215
215
|
});
|
|
216
216
|
return [
|
|
217
217
|
4,
|
|
218
218
|
injectAssetPrefix({
|
|
219
|
-
api,
|
|
220
|
-
chain
|
|
219
|
+
api: api,
|
|
220
|
+
chain: chain
|
|
221
221
|
})
|
|
222
222
|
];
|
|
223
223
|
case 1:
|
|
@@ -296,7 +296,7 @@ function applyBottomHtmlPlugin(param) {
|
|
|
296
296
|
var _loop = function() {
|
|
297
297
|
var entryName = _step.value;
|
|
298
298
|
var baseTemplateParams = _object_spread({
|
|
299
|
-
entryName,
|
|
299
|
+
entryName: entryName,
|
|
300
300
|
title: getEntryOptions(entryName, modernConfig.html.title, modernConfig.html.titleByEntries, appContext.packageName),
|
|
301
301
|
mountId: modernConfig.html.mountId
|
|
302
302
|
}, getEntryOptions(entryName, modernConfig.html.templateParameters, modernConfig.html.templateParametersByEntries, appContext.packageName));
|
|
@@ -179,17 +179,17 @@ export var builderPluginAdapterSSR = function(options) {
|
|
|
179
179
|
"service-worker"
|
|
180
180
|
].includes(target)) {
|
|
181
181
|
applyFilterEntriesBySSRConfig({
|
|
182
|
-
isProd,
|
|
183
|
-
chain,
|
|
182
|
+
isProd: isProd,
|
|
183
|
+
chain: chain,
|
|
184
184
|
appNormalizedConfig: normalizedConfig2
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
if (isHtmlEnabled(builderConfig, target)) {
|
|
188
188
|
applyAsyncChunkHtmlPlugin({
|
|
189
|
-
chain,
|
|
189
|
+
chain: chain,
|
|
190
190
|
modernConfig: options.normalizedConfig,
|
|
191
|
-
CHAIN_ID,
|
|
192
|
-
HtmlBundlerPlugin
|
|
191
|
+
CHAIN_ID: CHAIN_ID,
|
|
192
|
+
HtmlBundlerPlugin: HtmlBundlerPlugin
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
return [
|
|
@@ -224,8 +224,7 @@ var __generator = function(thisArg, body) {
|
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
import path from "path";
|
|
227
|
-
import { fs } from "@modern-js/utils";
|
|
228
|
-
import { ROUTE_MANIFEST_FILE } from "@modern-js/utils/constants";
|
|
227
|
+
import { fs, ROUTE_MANIFEST_FILE } from "@modern-js/utils";
|
|
229
228
|
import { ROUTE_MANIFEST } from "@modern-js/utils/universal/constants";
|
|
230
229
|
var PLUGIN_NAME = "ModernjsRoutePlugin";
|
|
231
230
|
export var RouterPlugin = /* @__PURE__ */ function() {
|
|
@@ -293,8 +292,8 @@ export var RouterPlugin = /* @__PURE__ */ function() {
|
|
|
293
292
|
});
|
|
294
293
|
routeAssets[name] = {
|
|
295
294
|
chunkIds: chunkGroup.chunks,
|
|
296
|
-
assets,
|
|
297
|
-
referenceCssAssets
|
|
295
|
+
assets: assets,
|
|
296
|
+
referenceCssAssets: referenceCssAssets
|
|
298
297
|
};
|
|
299
298
|
}
|
|
300
299
|
} catch (err) {
|
|
@@ -312,7 +311,7 @@ export var RouterPlugin = /* @__PURE__ */ function() {
|
|
|
312
311
|
}
|
|
313
312
|
}
|
|
314
313
|
manifest = {
|
|
315
|
-
routeAssets
|
|
314
|
+
routeAssets: routeAssets
|
|
316
315
|
};
|
|
317
316
|
injectedContent = "\n ;(function(){\n window.".concat(ROUTE_MANIFEST, " = ").concat(JSON.stringify(manifest, function(k, v) {
|
|
318
317
|
if ((k === "assets" || k === "referenceCssAssets") && Array.isArray(v)) {
|
|
@@ -4,8 +4,8 @@ export function createCopyInfo(appContext, config) {
|
|
|
4
4
|
var uploadDir = path.posix.join(configDir.replace(/\\/g, "/"), "upload");
|
|
5
5
|
var publicDir = path.posix.join(configDir.replace(/\\/g, "/"), "public");
|
|
6
6
|
return {
|
|
7
|
-
configDir,
|
|
8
|
-
uploadDir,
|
|
9
|
-
publicDir
|
|
7
|
+
configDir: configDir,
|
|
8
|
+
uploadDir: uploadDir,
|
|
9
|
+
publicDir: publicDir
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -30,7 +30,7 @@ function _async_to_generator(fn) {
|
|
|
30
30
|
function _define_property(obj, key, value) {
|
|
31
31
|
if (key in obj) {
|
|
32
32
|
Object.defineProperty(obj, key, {
|
|
33
|
-
value,
|
|
33
|
+
value: value,
|
|
34
34
|
enumerable: true,
|
|
35
35
|
configurable: true,
|
|
36
36
|
writable: true
|
|
@@ -216,8 +216,8 @@ export var build = function() {
|
|
|
216
216
|
return [
|
|
217
217
|
4,
|
|
218
218
|
buildServerConfig({
|
|
219
|
-
appDirectory,
|
|
220
|
-
distDirectory,
|
|
219
|
+
appDirectory: appDirectory,
|
|
220
|
+
distDirectory: distDirectory,
|
|
221
221
|
configFile: serverConfigFile
|
|
222
222
|
})
|
|
223
223
|
];
|
package/dist/esm/commands/dev.js
CHANGED
|
@@ -30,7 +30,7 @@ function _async_to_generator(fn) {
|
|
|
30
30
|
function _define_property(obj, key, value) {
|
|
31
31
|
if (key in obj) {
|
|
32
32
|
Object.defineProperty(obj, key, {
|
|
33
|
-
value,
|
|
33
|
+
value: value,
|
|
34
34
|
enumerable: true,
|
|
35
35
|
configurable: true,
|
|
36
36
|
writable: true
|
|
@@ -208,8 +208,8 @@ export var dev = function() {
|
|
|
208
208
|
return [
|
|
209
209
|
4,
|
|
210
210
|
buildServerConfig({
|
|
211
|
-
appDirectory,
|
|
212
|
-
distDirectory,
|
|
211
|
+
appDirectory: appDirectory,
|
|
212
|
+
distDirectory: distDirectory,
|
|
213
213
|
configFile: serverConfigFile,
|
|
214
214
|
options: {
|
|
215
215
|
esbuildOptions: {
|
|
@@ -243,7 +243,7 @@ export var dev = function() {
|
|
|
243
243
|
serverInternalPlugins = _state.sent();
|
|
244
244
|
serverOptions = {
|
|
245
245
|
dev: _object_spread({
|
|
246
|
-
port,
|
|
246
|
+
port: port,
|
|
247
247
|
https: normalizedConfig.dev.https,
|
|
248
248
|
host: normalizedConfig.dev.host
|
|
249
249
|
}, (_normalizedConfig_tools = normalizedConfig.tools) === null || _normalizedConfig_tools === void 0 ? void 0 : _normalizedConfig_tools.devServer),
|
|
@@ -255,7 +255,7 @@ export var dev = function() {
|
|
|
255
255
|
},
|
|
256
256
|
pwd: appDirectory,
|
|
257
257
|
config: normalizedConfig,
|
|
258
|
-
serverConfigFile,
|
|
258
|
+
serverConfigFile: serverConfigFile,
|
|
259
259
|
internalPlugins: injectDataLoaderPlugin(serverInternalPlugins)
|
|
260
260
|
};
|
|
261
261
|
if (!apiOnly)
|
|
@@ -273,8 +273,8 @@ export var dev = function() {
|
|
|
273
273
|
app = _state.sent();
|
|
274
274
|
host = ((_normalizedConfig_dev = normalizedConfig.dev) === null || _normalizedConfig_dev === void 0 ? void 0 : _normalizedConfig_dev.host) || DEFAULT_DEV_HOST;
|
|
275
275
|
app.listen({
|
|
276
|
-
port,
|
|
277
|
-
host
|
|
276
|
+
port: port,
|
|
277
|
+
host: host
|
|
278
278
|
}, function() {
|
|
279
279
|
var _ref2 = _async_to_generator(function(err) {
|
|
280
280
|
return __generator(this, function(_state2) {
|
|
@@ -300,7 +300,7 @@ export var dev = function() {
|
|
|
300
300
|
4,
|
|
301
301
|
appContext.builder.startDevServer({
|
|
302
302
|
printURLs: false,
|
|
303
|
-
serverOptions
|
|
303
|
+
serverOptions: serverOptions
|
|
304
304
|
})
|
|
305
305
|
];
|
|
306
306
|
case 7:
|
|
@@ -30,7 +30,7 @@ function _async_to_generator(fn) {
|
|
|
30
30
|
function _define_property(obj, key, value) {
|
|
31
31
|
if (key in obj) {
|
|
32
32
|
Object.defineProperty(obj, key, {
|
|
33
|
-
value,
|
|
33
|
+
value: value,
|
|
34
34
|
enumerable: true,
|
|
35
35
|
configurable: true,
|
|
36
36
|
writable: true
|
|
@@ -224,9 +224,9 @@ export var start = function() {
|
|
|
224
224
|
apiDirectory: getTargetDir(appContext.apiDirectory, appContext.appDirectory, appContext.distDirectory),
|
|
225
225
|
lambdaDirectory: getTargetDir(appContext.lambdaDirectory, appContext.appDirectory, appContext.distDirectory)
|
|
226
226
|
},
|
|
227
|
-
serverConfigFile,
|
|
227
|
+
serverConfigFile: serverConfigFile,
|
|
228
228
|
internalPlugins: injectDataLoaderPlugin(serverInternalPlugins),
|
|
229
|
-
apiOnly
|
|
229
|
+
apiOnly: apiOnly
|
|
230
230
|
})
|
|
231
231
|
];
|
|
232
232
|
case 3:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _define_property(obj, key, value) {
|
|
2
2
|
if (key in obj) {
|
|
3
3
|
Object.defineProperty(obj, key, {
|
|
4
|
-
value,
|
|
4
|
+
value: value,
|
|
5
5
|
enumerable: true,
|
|
6
6
|
configurable: true,
|
|
7
7
|
writable: true
|
|
@@ -100,12 +100,12 @@ export function createDefaultConfig(appContext, bundler) {
|
|
|
100
100
|
};
|
|
101
101
|
var tools = bundler === "webpack" ? _object_spread({}, defaultBuilderConfig.tools) : void 0;
|
|
102
102
|
return {
|
|
103
|
-
source,
|
|
104
|
-
output,
|
|
105
|
-
server,
|
|
106
|
-
dev,
|
|
107
|
-
html,
|
|
108
|
-
tools,
|
|
103
|
+
source: source,
|
|
104
|
+
output: output,
|
|
105
|
+
server: server,
|
|
106
|
+
dev: dev,
|
|
107
|
+
html: html,
|
|
108
|
+
tools: tools,
|
|
109
109
|
plugins: [],
|
|
110
110
|
builderPlugins: [],
|
|
111
111
|
runtime: {},
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export function createHtmlConfig(config) {
|
|
2
2
|
var _config_output = config.output, disableHtmlFolder = _config_output.disableHtmlFolder, favicon = _config_output.favicon, faviconByEntries = _config_output.faviconByEntries, inject = _config_output.inject, injectByEntries = _config_output.injectByEntries, meta = _config_output.meta, metaByEntries = _config_output.metaByEntries, mountId = _config_output.mountId, title = _config_output.title, titleByEntries = _config_output.titleByEntries, templateParameters = _config_output.templateParameters, templateParametersByEntries = _config_output.templateParametersByEntries, crossorigin = _config_output.crossorigin;
|
|
3
3
|
return {
|
|
4
|
-
disableHtmlFolder,
|
|
5
|
-
favicon,
|
|
6
|
-
faviconByEntries,
|
|
7
|
-
inject,
|
|
8
|
-
injectByEntries,
|
|
9
|
-
meta,
|
|
10
|
-
metaByEntries,
|
|
11
|
-
mountId,
|
|
12
|
-
title,
|
|
13
|
-
titleByEntries,
|
|
14
|
-
crossorigin,
|
|
15
|
-
templateParameters,
|
|
16
|
-
templateParametersByEntries
|
|
4
|
+
disableHtmlFolder: disableHtmlFolder,
|
|
5
|
+
favicon: favicon,
|
|
6
|
+
faviconByEntries: faviconByEntries,
|
|
7
|
+
inject: inject,
|
|
8
|
+
injectByEntries: injectByEntries,
|
|
9
|
+
meta: meta,
|
|
10
|
+
metaByEntries: metaByEntries,
|
|
11
|
+
mountId: mountId,
|
|
12
|
+
title: title,
|
|
13
|
+
titleByEntries: titleByEntries,
|
|
14
|
+
crossorigin: crossorigin,
|
|
15
|
+
templateParameters: templateParameters,
|
|
16
|
+
templateParametersByEntries: templateParametersByEntries
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export function createOutputConfig(config) {
|
|
2
2
|
var _config_output = config.output, assetPrefix = _config_output.assetPrefix, copy = _config_output.copy, cssModuleLocalIdentName = _config_output.cssModuleLocalIdentName, cssPath = _config_output.cssPath, jsPath = _config_output.jsPath, htmlPath = _config_output.htmlPath, mediaPath = _config_output.mediaPath, enableTsLoader = _config_output.enableTsLoader, path = _config_output.path, disableInlineRuntimeChunk = _config_output.disableInlineRuntimeChunk, disableCssExtract = _config_output.disableCssExtract, disableMinimize = _config_output.disableMinimize, disableSourceMap = _config_output.disableSourceMap, disableTsChecker = _config_output.disableTsChecker, enableCssModuleTSDeclaration = _config_output.enableCssModuleTSDeclaration, enableInlineScripts = _config_output.enableInlineScripts, enableInlineStyles = _config_output.enableInlineStyles, polyfill = _config_output.polyfill, dataUriLimit = _config_output.dataUriLimit, disableAssetsCache = _config_output.disableAssetsCache, enableLatestDecorators = _config_output.enableLatestDecorators, disableCssModuleExtension = _config_output.disableCssModuleExtension, ssg = _config_output.ssg, disableNodePolyfill = _config_output.disableNodePolyfill;
|
|
3
3
|
return {
|
|
4
|
-
assetPrefix,
|
|
5
|
-
copy,
|
|
4
|
+
assetPrefix: assetPrefix,
|
|
5
|
+
copy: copy,
|
|
6
6
|
distPath: {
|
|
7
7
|
root: path,
|
|
8
8
|
css: cssPath,
|
|
@@ -20,23 +20,23 @@ export function createOutputConfig(config) {
|
|
|
20
20
|
font: dataUriLimit,
|
|
21
21
|
media: dataUriLimit
|
|
22
22
|
},
|
|
23
|
-
cssModuleLocalIdentName,
|
|
24
|
-
disableCssExtract,
|
|
25
|
-
disableCssModuleExtension,
|
|
26
|
-
disableInlineRuntimeChunk,
|
|
27
|
-
disableMinimize,
|
|
28
|
-
disableSourceMap,
|
|
23
|
+
cssModuleLocalIdentName: cssModuleLocalIdentName,
|
|
24
|
+
disableCssExtract: disableCssExtract,
|
|
25
|
+
disableCssModuleExtension: disableCssModuleExtension,
|
|
26
|
+
disableInlineRuntimeChunk: disableInlineRuntimeChunk,
|
|
27
|
+
disableMinimize: disableMinimize,
|
|
28
|
+
disableSourceMap: disableSourceMap,
|
|
29
29
|
disableTsChecker: disableTsChecker || enableTsLoader,
|
|
30
|
-
enableCssModuleTSDeclaration,
|
|
31
|
-
enableInlineScripts,
|
|
32
|
-
enableInlineStyles,
|
|
33
|
-
polyfill,
|
|
30
|
+
enableCssModuleTSDeclaration: enableCssModuleTSDeclaration,
|
|
31
|
+
enableInlineScripts: enableInlineScripts,
|
|
32
|
+
enableInlineStyles: enableInlineStyles,
|
|
33
|
+
polyfill: polyfill,
|
|
34
34
|
disableFilenameHash: disableAssetsCache,
|
|
35
|
-
enableLatestDecorators,
|
|
36
|
-
ssg,
|
|
35
|
+
enableLatestDecorators: enableLatestDecorators,
|
|
36
|
+
ssg: ssg,
|
|
37
37
|
// set `true`, only in legacy config
|
|
38
38
|
enableAssetFallback: true,
|
|
39
39
|
enableAssetManifest: true,
|
|
40
|
-
disableNodePolyfill
|
|
40
|
+
disableNodePolyfill: disableNodePolyfill
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -23,16 +23,16 @@ export function createSourceConfig(config) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return {
|
|
26
|
-
alias,
|
|
27
|
-
moduleScopes,
|
|
26
|
+
alias: alias,
|
|
27
|
+
moduleScopes: moduleScopes,
|
|
28
28
|
globalVars: builderGlobalVars,
|
|
29
|
-
include,
|
|
30
|
-
preEntry,
|
|
31
|
-
entries,
|
|
32
|
-
enableAsyncEntry,
|
|
33
|
-
disableDefaultEntries,
|
|
34
|
-
entriesDir,
|
|
35
|
-
configDir,
|
|
29
|
+
include: include,
|
|
30
|
+
preEntry: preEntry,
|
|
31
|
+
entries: entries,
|
|
32
|
+
enableAsyncEntry: enableAsyncEntry,
|
|
33
|
+
disableDefaultEntries: disableDefaultEntries,
|
|
34
|
+
entriesDir: entriesDir,
|
|
35
|
+
configDir: configDir,
|
|
36
36
|
resolveExtensionPrefix: {
|
|
37
37
|
web: ".web",
|
|
38
38
|
node: ".node"
|
|
@@ -3,20 +3,20 @@ export function createToolsConfig(config) {
|
|
|
3
3
|
var enableTsLoader = config.output.enableTsLoader;
|
|
4
4
|
return {
|
|
5
5
|
tsLoader: enableTsLoader ? tsLoader : void 0,
|
|
6
|
-
autoprefixer,
|
|
7
|
-
babel,
|
|
8
|
-
minifyCss,
|
|
9
|
-
terser,
|
|
10
|
-
webpack,
|
|
11
|
-
webpackChain,
|
|
12
|
-
styledComponents,
|
|
13
|
-
sass,
|
|
14
|
-
postcss,
|
|
15
|
-
less,
|
|
16
|
-
htmlPlugin,
|
|
17
|
-
devServer,
|
|
18
|
-
tailwindcss,
|
|
19
|
-
jest,
|
|
6
|
+
autoprefixer: autoprefixer,
|
|
7
|
+
babel: babel,
|
|
8
|
+
minifyCss: minifyCss,
|
|
9
|
+
terser: terser,
|
|
10
|
+
webpack: webpack,
|
|
11
|
+
webpackChain: webpackChain,
|
|
12
|
+
styledComponents: styledComponents,
|
|
13
|
+
sass: sass,
|
|
14
|
+
postcss: postcss,
|
|
15
|
+
less: less,
|
|
16
|
+
htmlPlugin: htmlPlugin,
|
|
17
|
+
devServer: devServer,
|
|
18
|
+
tailwindcss: tailwindcss,
|
|
19
|
+
jest: jest,
|
|
20
20
|
esbuild: {
|
|
21
21
|
loader: false,
|
|
22
22
|
minimize: esbuild
|
|
@@ -9,24 +9,24 @@ export function transformNormalizedConfig(config) {
|
|
|
9
9
|
var tools = createToolsConfig(config);
|
|
10
10
|
var bff = config.bff, dev = config.dev, deploy = config.deploy, runtime = config.runtime, runtimeByEntries = config.runtimeByEntries, server = config.server, cliOptions = config.cliOptions, plugins = config.plugins, testing = config.testing, autoLoadPlugins = config.autoLoadPlugins;
|
|
11
11
|
return {
|
|
12
|
-
source,
|
|
13
|
-
html,
|
|
14
|
-
output,
|
|
15
|
-
tools,
|
|
16
|
-
bff,
|
|
17
|
-
dev,
|
|
18
|
-
deploy,
|
|
19
|
-
runtime,
|
|
20
|
-
runtimeByEntries,
|
|
21
|
-
server,
|
|
22
|
-
cliOptions,
|
|
23
|
-
testing,
|
|
12
|
+
source: source,
|
|
13
|
+
html: html,
|
|
14
|
+
output: output,
|
|
15
|
+
tools: tools,
|
|
16
|
+
bff: bff,
|
|
17
|
+
dev: dev,
|
|
18
|
+
deploy: deploy,
|
|
19
|
+
runtime: runtime,
|
|
20
|
+
runtimeByEntries: runtimeByEntries,
|
|
21
|
+
server: server,
|
|
22
|
+
cliOptions: cliOptions,
|
|
23
|
+
testing: testing,
|
|
24
24
|
builderPlugins: [],
|
|
25
|
-
plugins,
|
|
25
|
+
plugins: plugins,
|
|
26
26
|
security: {},
|
|
27
27
|
_raw: {},
|
|
28
28
|
experiments: {},
|
|
29
|
-
autoLoadPlugins,
|
|
29
|
+
autoLoadPlugins: autoLoadPlugins,
|
|
30
30
|
performance: {
|
|
31
31
|
removeMomentLocale: true
|
|
32
32
|
}
|