@modern-js/app-tools 2.14.0 → 2.16.0
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 +74 -0
- package/dist/cjs/analyze/constants.js +37 -61
- package/dist/cjs/analyze/generateCode.js +102 -127
- package/dist/cjs/analyze/getBundleEntry.js +33 -66
- package/dist/cjs/analyze/getClientRoutes/getRoutes.js +61 -117
- package/dist/cjs/analyze/getClientRoutes/getRoutesLegacy.js +61 -115
- package/dist/cjs/analyze/getClientRoutes/index.js +15 -28
- package/dist/cjs/analyze/getClientRoutes/utils.js +24 -48
- package/dist/cjs/analyze/getFileSystemEntry.js +39 -79
- package/dist/cjs/analyze/getHtmlTemplate.js +88 -98
- package/dist/cjs/analyze/getServerRoutes.js +67 -110
- package/dist/cjs/analyze/index.js +265 -257
- package/dist/cjs/analyze/isDefaultExportFunction.js +66 -44
- package/dist/cjs/analyze/makeLegalIdentifier.js +7 -25
- package/dist/cjs/analyze/nestedRoutes.js +99 -104
- package/dist/cjs/analyze/templates.js +49 -110
- package/dist/cjs/analyze/utils.js +98 -102
- package/dist/cjs/builder/builder-rspack/adapterCopy.js +58 -100
- package/dist/cjs/builder/builder-rspack/index.js +14 -30
- package/dist/cjs/builder/builder-webpack/adapterModern.js +33 -50
- package/dist/cjs/builder/builder-webpack/createCopyPattern.js +16 -32
- package/dist/cjs/builder/builder-webpack/index.js +65 -46
- package/dist/cjs/builder/generator/createBuilderOptions.js +10 -26
- package/dist/cjs/builder/generator/createBuilderProviderConfig.js +11 -27
- package/dist/cjs/builder/generator/getBuilderTargets.js +13 -29
- package/dist/cjs/builder/generator/index.js +61 -55
- package/dist/cjs/builder/index.js +53 -43
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +13 -36
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +90 -90
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +108 -111
- package/dist/cjs/builder/shared/builderPlugins/index.js +20 -19
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +30 -30
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +32 -38
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +86 -116
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +20 -19
- package/dist/cjs/builder/shared/createCopyInfo.js +16 -42
- package/dist/cjs/builder/shared/index.js +20 -19
- package/dist/cjs/builder/shared/loaders/serverModuleLoader.js +8 -24
- package/dist/cjs/builder/shared/types.js +4 -15
- package/dist/cjs/commands/build.js +23 -40
- package/dist/cjs/commands/deploy.js +7 -25
- package/dist/cjs/commands/dev.js +38 -57
- package/dist/cjs/commands/index.js +20 -19
- package/dist/cjs/commands/inspect.js +10 -30
- package/dist/cjs/commands/serve.js +28 -66
- package/dist/cjs/config/default.js +34 -34
- package/dist/cjs/config/index.js +20 -19
- package/dist/cjs/config/initialize/index.js +11 -29
- package/dist/cjs/config/initialize/inits.js +103 -82
- package/dist/cjs/config/legacy/createHtmlConfig.js +8 -40
- package/dist/cjs/config/legacy/createOutputConfig.js +8 -51
- package/dist/cjs/config/legacy/createSourceConfig.js +8 -38
- package/dist/cjs/config/legacy/createToolsConfig.js +8 -43
- package/dist/cjs/config/legacy/index.js +22 -46
- package/dist/cjs/defineConfig.js +16 -31
- package/dist/cjs/exports/server.js +7 -25
- package/dist/cjs/hooks.js +33 -51
- package/dist/cjs/index.js +185 -166
- package/dist/cjs/initialize/index.js +84 -100
- package/dist/cjs/locale/en.js +13 -27
- package/dist/cjs/locale/index.js +18 -28
- package/dist/cjs/locale/zh.js +13 -27
- package/dist/cjs/schema/Schema.js +27 -31
- package/dist/cjs/schema/index.js +141 -71
- package/dist/cjs/schema/legacy.js +273 -96
- package/dist/cjs/types/config/deploy.js +4 -15
- package/dist/cjs/types/config/dev.js +4 -15
- package/dist/cjs/types/config/experiments.js +4 -15
- package/dist/cjs/types/config/html.js +4 -15
- package/dist/cjs/types/config/index.js +18 -17
- package/dist/cjs/types/config/output.js +4 -15
- package/dist/cjs/types/config/performance.js +4 -15
- package/dist/cjs/types/config/security.js +4 -15
- package/dist/cjs/types/config/source.js +4 -15
- package/dist/cjs/types/config/tools.js +4 -15
- package/dist/cjs/types/hooks.js +4 -15
- package/dist/cjs/types/index.js +20 -19
- package/dist/cjs/types/legacyConfig/deploy.js +4 -15
- package/dist/cjs/types/legacyConfig/dev.js +4 -15
- package/dist/cjs/types/legacyConfig/index.js +4 -15
- package/dist/cjs/types/legacyConfig/output.js +4 -15
- package/dist/cjs/types/legacyConfig/source.js +4 -15
- package/dist/cjs/types/legacyConfig/tools.js +4 -15
- package/dist/cjs/types/utils.js +4 -15
- package/dist/cjs/utils/config.js +74 -79
- package/dist/cjs/utils/createServer.js +16 -42
- package/dist/cjs/utils/env.js +7 -25
- package/dist/cjs/utils/generateWatchFiles.js +31 -52
- package/dist/cjs/utils/getSelectedEntries.js +13 -35
- package/dist/cjs/utils/getServerInternalPlugins.js +8 -29
- package/dist/cjs/utils/printInstructions.js +10 -28
- package/dist/cjs/utils/restart.js +13 -31
- package/dist/cjs/utils/routes.js +18 -39
- package/dist/cjs/utils/types.js +4 -15
- package/dist/esm/analyze/constants.js +40 -41
- package/dist/esm/analyze/generateCode.js +477 -455
- package/dist/esm/analyze/getBundleEntry.js +53 -54
- package/dist/esm/analyze/getClientRoutes/getRoutes.js +201 -202
- package/dist/esm/analyze/getClientRoutes/getRoutesLegacy.js +199 -200
- package/dist/esm/analyze/getClientRoutes/index.js +2 -3
- package/dist/esm/analyze/getClientRoutes/utils.js +15 -15
- package/dist/esm/analyze/getFileSystemEntry.js +86 -87
- package/dist/esm/analyze/getHtmlTemplate.js +289 -278
- package/dist/esm/analyze/getServerRoutes.js +203 -190
- package/dist/esm/analyze/index.js +679 -651
- package/dist/esm/analyze/isDefaultExportFunction.js +38 -39
- package/dist/esm/analyze/makeLegalIdentifier.js +8 -9
- package/dist/esm/analyze/nestedRoutes.js +400 -392
- package/dist/esm/analyze/templates.js +536 -509
- package/dist/esm/analyze/utils.js +357 -336
- package/dist/esm/builder/builder-rspack/adapterCopy.js +347 -330
- package/dist/esm/builder/builder-rspack/index.js +8 -9
- package/dist/esm/builder/builder-webpack/adapterModern.js +51 -43
- package/dist/esm/builder/builder-webpack/createCopyPattern.js +31 -32
- package/dist/esm/builder/builder-webpack/index.js +266 -249
- package/dist/esm/builder/generator/createBuilderOptions.js +37 -38
- package/dist/esm/builder/generator/createBuilderProviderConfig.js +62 -63
- package/dist/esm/builder/generator/getBuilderTargets.js +13 -14
- package/dist/esm/builder/generator/index.js +203 -196
- package/dist/esm/builder/index.js +183 -176
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.js +90 -91
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +300 -291
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +337 -329
- package/dist/esm/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +108 -97
- package/dist/esm/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +66 -64
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +364 -337
- package/dist/esm/builder/shared/createCopyInfo.js +9 -10
- package/dist/esm/builder/shared/loaders/serverModuleLoader.js +2 -3
- package/dist/esm/builder/shared/types.js +1 -1
- package/dist/esm/commands/build.js +279 -272
- package/dist/esm/commands/deploy.js +150 -144
- package/dist/esm/commands/dev.js +296 -289
- package/dist/esm/commands/inspect.js +144 -138
- package/dist/esm/commands/serve.js +241 -235
- package/dist/esm/config/default.js +202 -203
- package/dist/esm/config/initialize/index.js +7 -8
- package/dist/esm/config/initialize/inits.js +189 -181
- package/dist/esm/config/legacy/createHtmlConfig.js +17 -18
- package/dist/esm/config/legacy/createOutputConfig.js +41 -42
- package/dist/esm/config/legacy/createSourceConfig.js +38 -39
- package/dist/esm/config/legacy/createToolsConfig.js +24 -25
- package/dist/esm/config/legacy/index.js +31 -32
- package/dist/esm/defineConfig.js +52 -53
- package/dist/esm/exports/server.js +1 -2
- package/dist/esm/hooks.js +26 -27
- package/dist/esm/index.js +685 -671
- package/dist/esm/initialize/index.js +276 -269
- package/dist/esm/locale/en.js +36 -37
- package/dist/esm/locale/index.js +2 -2
- package/dist/esm/locale/zh.js +36 -37
- package/dist/esm/schema/Schema.js +255 -244
- package/dist/esm/schema/index.js +165 -165
- package/dist/esm/schema/legacy.js +316 -317
- package/dist/esm/types/config/deploy.js +1 -1
- package/dist/esm/types/config/dev.js +1 -1
- package/dist/esm/types/config/experiments.js +1 -1
- package/dist/esm/types/config/html.js +1 -1
- package/dist/esm/types/config/output.js +1 -1
- package/dist/esm/types/config/performance.js +1 -1
- package/dist/esm/types/config/security.js +1 -1
- package/dist/esm/types/config/source.js +1 -1
- package/dist/esm/types/config/tools.js +1 -1
- package/dist/esm/types/hooks.js +1 -1
- package/dist/esm/types/legacyConfig/deploy.js +1 -1
- package/dist/esm/types/legacyConfig/dev.js +1 -1
- package/dist/esm/types/legacyConfig/index.js +1 -1
- package/dist/esm/types/legacyConfig/output.js +1 -1
- package/dist/esm/types/legacyConfig/source.js +1 -1
- package/dist/esm/types/legacyConfig/tools.js +1 -1
- package/dist/esm/types/utils.js +1 -1
- package/dist/esm/utils/config.js +285 -278
- package/dist/esm/utils/createServer.js +242 -234
- package/dist/esm/utils/env.js +11 -12
- package/dist/esm/utils/generateWatchFiles.js +205 -190
- package/dist/esm/utils/getSelectedEntries.js +180 -173
- package/dist/esm/utils/getServerInternalPlugins.js +197 -191
- package/dist/esm/utils/printInstructions.js +147 -141
- package/dist/esm/utils/restart.js +179 -173
- package/dist/esm/utils/routes.js +146 -139
- package/dist/esm/utils/types.js +1 -1
- package/dist/esm-node/analyze/constants.js +31 -46
- package/dist/esm-node/analyze/generateCode.js +28 -94
- package/dist/esm-node/analyze/getBundleEntry.js +8 -27
- package/dist/esm-node/analyze/getClientRoutes/getRoutes.js +24 -65
- package/dist/esm-node/analyze/getClientRoutes/getRoutesLegacy.js +24 -63
- package/dist/esm-node/analyze/getClientRoutes/index.js +2 -6
- package/dist/esm-node/analyze/getClientRoutes/utils.js +5 -19
- package/dist/esm-node/analyze/getFileSystemEntry.js +10 -37
- package/dist/esm-node/analyze/getHtmlTemplate.js +29 -59
- package/dist/esm-node/analyze/getServerRoutes.js +43 -75
- package/dist/esm-node/analyze/index.js +208 -230
- package/dist/esm-node/analyze/isDefaultExportFunction.js +7 -5
- package/dist/esm-node/analyze/makeLegalIdentifier.js +1 -4
- package/dist/esm-node/analyze/nestedRoutes.js +23 -43
- package/dist/esm-node/analyze/templates.js +22 -69
- package/dist/esm-node/analyze/utils.js +66 -60
- package/dist/esm-node/builder/builder-rspack/adapterCopy.js +40 -62
- package/dist/esm-node/builder/builder-rspack/index.js +4 -5
- package/dist/esm-node/builder/builder-webpack/adapterModern.js +24 -26
- package/dist/esm-node/builder/builder-webpack/createCopyPattern.js +3 -10
- package/dist/esm-node/builder/builder-webpack/index.js +13 -11
- package/dist/esm-node/builder/generator/createBuilderOptions.js +4 -5
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.js +5 -6
- package/dist/esm-node/builder/generator/getBuilderTargets.js +5 -11
- package/dist/esm-node/builder/generator/index.js +7 -16
- package/dist/esm-node/builder/index.js +2 -7
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.js +2 -6
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +34 -60
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +54 -74
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +23 -8
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +25 -16
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +66 -76
- package/dist/esm-node/builder/shared/createCopyInfo.js +2 -8
- package/dist/esm-node/builder/shared/loaders/serverModuleLoader.js +1 -4
- package/dist/esm-node/builder/shared/types.js +1 -0
- package/dist/esm-node/commands/build.js +7 -9
- package/dist/esm-node/commands/deploy.js +1 -4
- package/dist/esm-node/commands/dev.js +19 -27
- package/dist/esm-node/commands/inspect.js +3 -8
- package/dist/esm-node/commands/serve.js +7 -25
- package/dist/esm-node/config/default.js +20 -11
- package/dist/esm-node/config/initialize/index.js +1 -4
- package/dist/esm-node/config/initialize/inits.js +48 -54
- package/dist/esm-node/config/legacy/createHtmlConfig.js +2 -19
- package/dist/esm-node/config/legacy/createOutputConfig.js +2 -30
- package/dist/esm-node/config/legacy/createSourceConfig.js +2 -17
- package/dist/esm-node/config/legacy/createToolsConfig.js +2 -22
- package/dist/esm-node/config/legacy/index.js +3 -18
- package/dist/esm-node/defineConfig.js +7 -13
- package/dist/esm-node/exports/server.js +1 -4
- package/dist/esm-node/hooks.js +2 -9
- package/dist/esm-node/index.js +95 -120
- package/dist/esm-node/initialize/index.js +74 -87
- package/dist/esm-node/locale/en.js +7 -6
- package/dist/esm-node/locale/index.js +5 -5
- package/dist/esm-node/locale/zh.js +7 -6
- package/dist/esm-node/schema/Schema.js +19 -8
- package/dist/esm-node/schema/index.js +121 -36
- package/dist/esm-node/schema/legacy.js +262 -72
- package/dist/esm-node/types/config/deploy.js +1 -0
- package/dist/esm-node/types/config/dev.js +1 -0
- package/dist/esm-node/types/config/experiments.js +1 -0
- package/dist/esm-node/types/config/html.js +1 -0
- package/dist/esm-node/types/config/output.js +1 -0
- package/dist/esm-node/types/config/performance.js +1 -0
- package/dist/esm-node/types/config/security.js +1 -0
- package/dist/esm-node/types/config/source.js +1 -0
- package/dist/esm-node/types/config/tools.js +1 -0
- package/dist/esm-node/types/hooks.js +1 -0
- package/dist/esm-node/types/legacyConfig/deploy.js +1 -0
- package/dist/esm-node/types/legacyConfig/dev.js +1 -0
- package/dist/esm-node/types/legacyConfig/index.js +1 -0
- package/dist/esm-node/types/legacyConfig/output.js +1 -0
- package/dist/esm-node/types/legacyConfig/source.js +1 -0
- package/dist/esm-node/types/legacyConfig/tools.js +1 -0
- package/dist/esm-node/types/utils.js +1 -0
- package/dist/esm-node/utils/config.js +16 -47
- package/dist/esm-node/utils/createServer.js +5 -12
- package/dist/esm-node/utils/env.js +1 -4
- package/dist/esm-node/utils/generateWatchFiles.js +13 -20
- package/dist/esm-node/utils/getSelectedEntries.js +2 -9
- package/dist/esm-node/utils/getServerInternalPlugins.js +2 -8
- package/dist/esm-node/utils/printInstructions.js +1 -4
- package/dist/esm-node/utils/restart.js +2 -11
- package/dist/esm-node/utils/routes.js +4 -4
- package/dist/esm-node/utils/types.js +1 -0
- package/dist/types/index.d.ts +2 -2
- package/lib/types.d.ts +1 -0
- package/package.json +29 -25
|
@@ -1,104 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var adapterCopy_exports = {};
|
|
29
|
-
__export(adapterCopy_exports, {
|
|
30
|
-
builderPluginAdpaterCopy: () => builderPluginAdpaterCopy
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "builderPluginAdpaterCopy", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => builderPluginAdpaterCopy
|
|
31
8
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
9
|
+
const _path = /* @__PURE__ */ _interop_require_default(require("path"));
|
|
10
|
+
const _fsextra = /* @__PURE__ */ _interop_require_default(require("@modern-js/utils/fs-extra"));
|
|
11
|
+
const _utils = require("@modern-js/utils");
|
|
12
|
+
const _shared = require("../shared");
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const builderPluginAdpaterCopy = (options) => {
|
|
19
|
+
return {
|
|
20
|
+
name: "builder-plugin-adapter-rspack-copy",
|
|
21
|
+
setup(api) {
|
|
22
|
+
let publicPath;
|
|
23
|
+
api.modifyRspackConfig((config) => {
|
|
24
|
+
var _config_builtins, _config_builtins_copy, _config_output;
|
|
25
|
+
config.builtins = {
|
|
26
|
+
...config.builtins || {},
|
|
27
|
+
copy: {
|
|
28
|
+
patterns: [
|
|
29
|
+
...transformCopy((_config_builtins = config.builtins) === null || _config_builtins === void 0 ? void 0 : (_config_builtins_copy = _config_builtins.copy) === null || _config_builtins_copy === void 0 ? void 0 : _config_builtins_copy.patterns),
|
|
30
|
+
...createConfigBuiltinCopy(options)
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
publicPath = (_config_output = config.output) === null || _config_output === void 0 ? void 0 : _config_output.publicPath;
|
|
35
|
+
});
|
|
36
|
+
api.onDevCompileDone(async () => {
|
|
37
|
+
await transformHtmlFiles();
|
|
38
|
+
});
|
|
39
|
+
api.onAfterBuild(async () => {
|
|
40
|
+
await transformHtmlFiles();
|
|
41
|
+
});
|
|
42
|
+
async function transformHtmlFiles() {
|
|
43
|
+
var _normalizedConfig_output_distPath;
|
|
44
|
+
const { normalizedConfig } = options;
|
|
45
|
+
const publicDir = _path.default.resolve(((_normalizedConfig_output_distPath = normalizedConfig.output.distPath) === null || _normalizedConfig_output_distPath === void 0 ? void 0 : _normalizedConfig_output_distPath.root) || "./dist", "./public");
|
|
46
|
+
if (!_fsextra.default.existsSync(publicDir) || !_fsextra.default.statSync(publicDir).isDirectory()) {
|
|
47
|
+
return;
|
|
50
48
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
await transformHtmlFiles();
|
|
56
|
-
});
|
|
57
|
-
api.onAfterBuild(async () => {
|
|
58
|
-
await transformHtmlFiles();
|
|
59
|
-
});
|
|
60
|
-
async function transformHtmlFiles() {
|
|
61
|
-
var _a;
|
|
62
|
-
const { normalizedConfig } = options;
|
|
63
|
-
const publicDir = import_path.default.resolve(
|
|
64
|
-
((_a = normalizedConfig.output.distPath) == null ? void 0 : _a.root) || "./dist",
|
|
65
|
-
"./public"
|
|
66
|
-
);
|
|
67
|
-
if (!import_fs_extra.default.existsSync(publicDir) || !import_fs_extra.default.statSync(publicDir).isDirectory()) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const HTML_REGEXP = /\.html?$/;
|
|
71
|
-
const filepaths = (await import_fs_extra.default.readdir(publicDir)).map(
|
|
72
|
-
(file) => import_path.default.resolve(publicDir, file)
|
|
73
|
-
);
|
|
74
|
-
await Promise.all(
|
|
75
|
-
filepaths.filter((file) => HTML_REGEXP.test(file)).map(async (file) => {
|
|
76
|
-
const content = await import_fs_extra.default.readFile(file, "utf-8");
|
|
49
|
+
const HTML_REGEXP = /\.html?$/;
|
|
50
|
+
const filepaths = (await _fsextra.default.readdir(publicDir)).map((file) => _path.default.resolve(publicDir, file));
|
|
51
|
+
await Promise.all(filepaths.filter((file) => HTML_REGEXP.test(file)).map(async (file) => {
|
|
52
|
+
const content = await _fsextra.default.readFile(file, "utf-8");
|
|
77
53
|
if (publicPath) {
|
|
78
|
-
await
|
|
79
|
-
file,
|
|
80
|
-
content.replace(
|
|
81
|
-
/<%=\s*assetPrefix\s*%>/g,
|
|
82
|
-
(0, import_utils.removeTailSlash)(publicPath)
|
|
83
|
-
)
|
|
84
|
-
);
|
|
54
|
+
await _fsextra.default.writeFile(file, content.replace(/<%=\s*assetPrefix\s*%>/g, (0, _utils.removeTailSlash)(publicPath)));
|
|
85
55
|
} else {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
);
|
|
89
|
-
await import_fs_extra.default.writeFile(
|
|
90
|
-
file,
|
|
91
|
-
content.replace(
|
|
92
|
-
/<%=\s*assetPrefix\s*%>/g,
|
|
93
|
-
(0, import_utils.removeTailSlash)("/")
|
|
94
|
-
)
|
|
95
|
-
);
|
|
56
|
+
_utils.logger.warn("Expect get a string from `publicPath`, but receive `undefined`.");
|
|
57
|
+
await _fsextra.default.writeFile(file, content.replace(/<%=\s*assetPrefix\s*%>/g, (0, _utils.removeTailSlash)("/")));
|
|
96
58
|
}
|
|
97
|
-
})
|
|
98
|
-
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
99
61
|
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
62
|
+
};
|
|
63
|
+
};
|
|
102
64
|
function transformCopy(patterns) {
|
|
103
65
|
if (patterns) {
|
|
104
66
|
patterns.map((value) => {
|
|
@@ -114,7 +76,7 @@ function transformCopy(patterns) {
|
|
|
114
76
|
}
|
|
115
77
|
function createConfigBuiltinCopy(options) {
|
|
116
78
|
const { normalizedConfig, appContext } = options;
|
|
117
|
-
const { uploadDir, publicDir } = (0,
|
|
79
|
+
const { uploadDir, publicDir } = (0, _shared.createCopyInfo)(appContext, normalizedConfig);
|
|
118
80
|
return [
|
|
119
81
|
{
|
|
120
82
|
from: "**/*",
|
|
@@ -130,7 +92,3 @@ function createConfigBuiltinCopy(options) {
|
|
|
130
92
|
}
|
|
131
93
|
];
|
|
132
94
|
}
|
|
133
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
-
0 && (module.exports = {
|
|
135
|
-
builderPluginAdpaterCopy
|
|
136
|
-
});
|
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var builder_rspack_exports = {};
|
|
19
|
-
__export(builder_rspack_exports, {
|
|
20
|
-
createRspackBuilderForModern: () => createRspackBuilderForModern
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
Object.defineProperty(exports, "createRspackBuilderForModern", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => createRspackBuilderForModern
|
|
8
|
+
});
|
|
9
|
+
const _builderrspackprovider = require("@modern-js/builder-rspack-provider");
|
|
10
|
+
const _generator = require("../generator");
|
|
11
|
+
const _adapterCopy = require("./adapterCopy");
|
|
26
12
|
function createRspackBuilderForModern(options) {
|
|
27
|
-
return (0,
|
|
13
|
+
return (0, _generator.generateBuilder)(options, _builderrspackprovider.builderRspackProvider, {
|
|
28
14
|
modifyBuilderInstance(builder) {
|
|
29
|
-
builder.addPlugins([
|
|
15
|
+
builder.addPlugins([
|
|
16
|
+
(0, _adapterCopy.builderPluginAdpaterCopy)(options)
|
|
17
|
+
]);
|
|
30
18
|
}
|
|
31
19
|
});
|
|
32
20
|
}
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
createRspackBuilderForModern
|
|
36
|
-
});
|
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var adapterModern_exports = {};
|
|
19
|
-
__export(adapterModern_exports, {
|
|
20
|
-
builderPluginAdapterModern: () => builderPluginAdapterModern
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const builderPluginAdapterModern = (options) => ({
|
|
26
|
-
name: "builder-plugin-adapter-",
|
|
27
|
-
setup(api) {
|
|
28
|
-
const { normalizedConfig: modernConfig, appContext } = options;
|
|
29
|
-
api.modifyWebpackChain((chain, { CHAIN_ID }) => {
|
|
30
|
-
chain.resolve.modules.add("node_modules").add((0, import_path.join)(api.context.rootPath, "node_modules"));
|
|
31
|
-
if (chain.plugins.has(CHAIN_ID.PLUGIN.COPY)) {
|
|
32
|
-
const defaultCopyPattern = (0, import_createCopyPattern.createPublicPattern)(
|
|
33
|
-
appContext,
|
|
34
|
-
modernConfig,
|
|
35
|
-
chain
|
|
36
|
-
);
|
|
37
|
-
chain.plugin(CHAIN_ID.PLUGIN.COPY).tap((args) => {
|
|
38
|
-
var _a;
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
patterns: [...((_a = args[0]) == null ? void 0 : _a.patterns) || [], defaultCopyPattern]
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
builderPluginAdapterModern
|
|
5
|
+
Object.defineProperty(exports, "builderPluginAdapterModern", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => builderPluginAdapterModern
|
|
52
8
|
});
|
|
9
|
+
const _path = require("path");
|
|
10
|
+
const _createCopyPattern = require("./createCopyPattern");
|
|
11
|
+
const builderPluginAdapterModern = (options) => {
|
|
12
|
+
return {
|
|
13
|
+
name: "builder-plugin-adapter-",
|
|
14
|
+
setup(api) {
|
|
15
|
+
const { normalizedConfig: modernConfig, appContext } = options;
|
|
16
|
+
api.modifyWebpackChain((chain, { CHAIN_ID }) => {
|
|
17
|
+
chain.resolve.modules.add("node_modules").add((0, _path.join)(api.context.rootPath, "node_modules"));
|
|
18
|
+
if (chain.plugins.has(CHAIN_ID.PLUGIN.COPY)) {
|
|
19
|
+
const defaultCopyPattern = (0, _createCopyPattern.createPublicPattern)(appContext, modernConfig, chain);
|
|
20
|
+
chain.plugin(CHAIN_ID.PLUGIN.COPY).tap((args) => {
|
|
21
|
+
var _args_;
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
patterns: [
|
|
25
|
+
...((_args_ = args[0]) === null || _args_ === void 0 ? void 0 : _args_.patterns) || [],
|
|
26
|
+
defaultCopyPattern
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
6
|
for (var name in all)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var createCopyPattern_exports = {};
|
|
19
|
-
__export(createCopyPattern_exports, {
|
|
7
|
+
Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
20
13
|
createPublicPattern: () => createPublicPattern,
|
|
21
14
|
createUploadPattern: () => createUploadPattern
|
|
22
15
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var import_shared = require("../shared");
|
|
16
|
+
const _utils = require("@modern-js/utils");
|
|
17
|
+
const _shared = require("../shared");
|
|
26
18
|
const minifiedJsRexExp = /\.min\.js/;
|
|
27
19
|
const info = (file) => ({
|
|
28
20
|
// If the file name ends with `.min.js`, we assume it's a compressed file.
|
|
@@ -31,7 +23,7 @@ const info = (file) => ({
|
|
|
31
23
|
minimized: minifiedJsRexExp.test(file.sourceFilename)
|
|
32
24
|
});
|
|
33
25
|
function createPublicPattern(appContext, config, chain) {
|
|
34
|
-
const { publicDir } = (0,
|
|
26
|
+
const { publicDir } = (0, _shared.createCopyInfo)(appContext, config);
|
|
35
27
|
return {
|
|
36
28
|
info,
|
|
37
29
|
from: "**/*",
|
|
@@ -43,15 +35,12 @@ function createPublicPattern(appContext, config, chain) {
|
|
|
43
35
|
if (!/\.html?$/.test(absoluteFrom)) {
|
|
44
36
|
return content;
|
|
45
37
|
}
|
|
46
|
-
return content.toString("utf8").replace(
|
|
47
|
-
/<%=\s*assetPrefix\s*%>/g,
|
|
48
|
-
(0, import_utils.removeTailSlash)(chain.output.get("publicPath"))
|
|
49
|
-
);
|
|
38
|
+
return content.toString("utf8").replace(/<%=\s*assetPrefix\s*%>/g, (0, _utils.removeTailSlash)(chain.output.get("publicPath")));
|
|
50
39
|
}
|
|
51
40
|
};
|
|
52
41
|
}
|
|
53
42
|
function createUploadPattern(appContext, config) {
|
|
54
|
-
const { uploadDir } = (0,
|
|
43
|
+
const { uploadDir } = (0, _shared.createCopyInfo)(appContext, config);
|
|
55
44
|
return {
|
|
56
45
|
info,
|
|
57
46
|
from: "**/*",
|
|
@@ -60,8 +49,3 @@ function createUploadPattern(appContext, config) {
|
|
|
60
49
|
noErrorOnMissing: true
|
|
61
50
|
};
|
|
62
51
|
}
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
createPublicPattern,
|
|
66
|
-
createUploadPattern
|
|
67
|
-
});
|
|
@@ -1,41 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var builder_webpack_exports = {};
|
|
29
|
-
__export(builder_webpack_exports, {
|
|
30
|
-
createWebpackBuilderForModern: () => createWebpackBuilderForModern
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createWebpackBuilderForModern", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => createWebpackBuilderForModern
|
|
31
8
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
const _builderwebpackprovider = require("@modern-js/builder-webpack-provider");
|
|
10
|
+
const _generator = require("../generator");
|
|
11
|
+
const _adapterModern = require("./adapterModern");
|
|
12
|
+
const _createCopyPattern = require("./createCopyPattern");
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
14
|
+
if (typeof WeakMap !== "function")
|
|
15
|
+
return null;
|
|
16
|
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
19
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
+
})(nodeInterop);
|
|
21
|
+
}
|
|
22
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
+
return {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
+
if (cache && cache.has(obj)) {
|
|
33
|
+
return cache.get(obj);
|
|
34
|
+
}
|
|
35
|
+
var newObj = {};
|
|
36
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
37
|
+
for (var key in obj) {
|
|
38
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
39
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
40
|
+
if (desc && (desc.get || desc.set)) {
|
|
41
|
+
Object.defineProperty(newObj, key, desc);
|
|
42
|
+
} else {
|
|
43
|
+
newObj[key] = obj[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
newObj.default = obj;
|
|
48
|
+
if (cache) {
|
|
49
|
+
cache.set(obj, newObj);
|
|
50
|
+
}
|
|
51
|
+
return newObj;
|
|
52
|
+
}
|
|
37
53
|
function createWebpackBuilderForModern(options) {
|
|
38
|
-
return (0,
|
|
54
|
+
return (0, _generator.generateBuilder)(options, _builderwebpackprovider.builderWebpackProvider, {
|
|
39
55
|
modifyBuilderConfig(config) {
|
|
40
56
|
modifyOutputConfig(config, options.appContext);
|
|
41
57
|
},
|
|
@@ -47,10 +63,13 @@ function createWebpackBuilderForModern(options) {
|
|
|
47
63
|
function modifyOutputConfig(config, appContext) {
|
|
48
64
|
config.output = createOutputConfig(config, appContext);
|
|
49
65
|
function createOutputConfig(config2, appContext2) {
|
|
50
|
-
const defaultCopyPattern = (0,
|
|
66
|
+
const defaultCopyPattern = (0, _createCopyPattern.createUploadPattern)(appContext2, config2);
|
|
51
67
|
const { copy } = config2.output;
|
|
52
|
-
const copyOptions = Array.isArray(copy) ? copy : copy
|
|
53
|
-
const builderCopy = [
|
|
68
|
+
const copyOptions = Array.isArray(copy) ? copy : copy === null || copy === void 0 ? void 0 : copy.patterns;
|
|
69
|
+
const builderCopy = [
|
|
70
|
+
...copyOptions || [],
|
|
71
|
+
defaultCopyPattern
|
|
72
|
+
];
|
|
54
73
|
return {
|
|
55
74
|
...config2.output,
|
|
56
75
|
copy: builderCopy
|
|
@@ -61,12 +80,12 @@ async function applyBuilderPlugins(builder, options) {
|
|
|
61
80
|
const { normalizedConfig } = options;
|
|
62
81
|
if (normalizedConfig.tools.esbuild) {
|
|
63
82
|
const { esbuild: esbuildOptions } = normalizedConfig.tools;
|
|
64
|
-
const { builderPluginEsbuild } = await Promise.resolve().then(() =>
|
|
65
|
-
builder.addPlugins([
|
|
83
|
+
const { builderPluginEsbuild } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard(require("@modern-js/builder-plugin-esbuild")));
|
|
84
|
+
builder.addPlugins([
|
|
85
|
+
builderPluginEsbuild(esbuildOptions)
|
|
86
|
+
]);
|
|
66
87
|
}
|
|
67
|
-
builder.addPlugins([
|
|
88
|
+
builder.addPlugins([
|
|
89
|
+
(0, _adapterModern.builderPluginAdapterModern)(options)
|
|
90
|
+
]);
|
|
68
91
|
}
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
createWebpackBuilderForModern
|
|
72
|
-
});
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var createBuilderOptions_exports = {};
|
|
19
|
-
__export(createBuilderOptions_exports, {
|
|
20
|
-
createBuilderOptions: () => createBuilderOptions
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createBuilderOptions", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => createBuilderOptions
|
|
21
8
|
});
|
|
22
|
-
module.exports = __toCommonJS(createBuilderOptions_exports);
|
|
23
9
|
function createBuilderOptions(target, appContext) {
|
|
24
10
|
const entries = {};
|
|
25
11
|
const { entrypoints = [], checkedEntries } = appContext;
|
|
@@ -30,7 +16,9 @@ function createBuilderOptions(target, appContext) {
|
|
|
30
16
|
if (entryName in entries) {
|
|
31
17
|
entries[entryName].push(entry);
|
|
32
18
|
} else {
|
|
33
|
-
entries[entryName] = [
|
|
19
|
+
entries[entryName] = [
|
|
20
|
+
entry
|
|
21
|
+
];
|
|
34
22
|
}
|
|
35
23
|
}
|
|
36
24
|
return {
|
|
@@ -41,7 +29,3 @@ function createBuilderOptions(target, appContext) {
|
|
|
41
29
|
framework: appContext.metaName
|
|
42
30
|
};
|
|
43
31
|
}
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
createBuilderOptions
|
|
47
|
-
});
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var createBuilderProviderConfig_exports = {};
|
|
19
|
-
__export(createBuilderProviderConfig_exports, {
|
|
20
|
-
createBuilderProviderConfig: () => createBuilderProviderConfig
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createBuilderProviderConfig", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => createBuilderProviderConfig
|
|
21
8
|
});
|
|
22
|
-
module.exports = __toCommonJS(createBuilderProviderConfig_exports);
|
|
23
9
|
function createBuilderProviderConfig(resolveConfig, appContext, modifyBuilderConfig) {
|
|
24
|
-
const htmlConfig = {
|
|
10
|
+
const htmlConfig = {
|
|
11
|
+
...resolveConfig.html
|
|
12
|
+
};
|
|
25
13
|
if (!htmlConfig.template) {
|
|
26
14
|
htmlConfig.templateByEntries = {
|
|
27
15
|
...htmlConfig.templateByEntries,
|
|
@@ -41,10 +29,6 @@ function createBuilderProviderConfig(resolveConfig, appContext, modifyBuilderCon
|
|
|
41
29
|
cleanDistPath: false
|
|
42
30
|
}
|
|
43
31
|
};
|
|
44
|
-
modifyBuilderConfig
|
|
32
|
+
modifyBuilderConfig === null || modifyBuilderConfig === void 0 ? void 0 : modifyBuilderConfig(config);
|
|
45
33
|
return config;
|
|
46
34
|
}
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
createBuilderProviderConfig
|
|
50
|
-
});
|