@modern-js/app-tools 2.17.0 → 2.18.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 +48 -0
- package/dist/cjs/analyze/constants.js +2 -2
- package/dist/cjs/initialize/index.js +2 -2
- 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 +3 -3
- 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 +1 -1
- package/dist/esm/schema/legacy.js +1 -1
- 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/initialize/index.js +2 -2
- package/dist/types/analyze/constants.d.ts +2 -2
- package/package.json +24 -24
|
@@ -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 [
|
|
@@ -293,8 +293,8 @@ export var RouterPlugin = /* @__PURE__ */ function() {
|
|
|
293
293
|
});
|
|
294
294
|
routeAssets[name] = {
|
|
295
295
|
chunkIds: chunkGroup.chunks,
|
|
296
|
-
assets,
|
|
297
|
-
referenceCssAssets
|
|
296
|
+
assets: assets,
|
|
297
|
+
referenceCssAssets: referenceCssAssets
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
} catch (err) {
|
|
@@ -312,7 +312,7 @@ export var RouterPlugin = /* @__PURE__ */ function() {
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
manifest = {
|
|
315
|
-
routeAssets
|
|
315
|
+
routeAssets: routeAssets
|
|
316
316
|
};
|
|
317
317
|
injectedContent = "\n ;(function(){\n window.".concat(ROUTE_MANIFEST, " = ").concat(JSON.stringify(manifest, function(k, v) {
|
|
318
318
|
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
|
}
|
package/dist/esm/defineConfig.js
CHANGED
package/dist/esm/index.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
|
|
@@ -477,7 +477,7 @@ export default function() {
|
|
|
477
477
|
setup: function(api) {
|
|
478
478
|
var locale = getLocaleLanguage();
|
|
479
479
|
i18n.changeLanguage({
|
|
480
|
-
locale
|
|
480
|
+
locale: locale
|
|
481
481
|
});
|
|
482
482
|
return {
|
|
483
483
|
commands: function commands(param) {
|
|
@@ -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
|
|
@@ -211,8 +211,8 @@ export default function(param) {
|
|
|
211
211
|
return schemas.generate();
|
|
212
212
|
};
|
|
213
213
|
return {
|
|
214
|
-
config,
|
|
215
|
-
validateSchema,
|
|
214
|
+
config: config,
|
|
215
|
+
validateSchema: validateSchema,
|
|
216
216
|
resolvedConfig: function resolvedConfig(param2) {
|
|
217
217
|
var resolved = param2.resolved;
|
|
218
218
|
return _async_to_generator(function() {
|
|
@@ -229,14 +229,14 @@ export default function(param) {
|
|
|
229
229
|
case 1:
|
|
230
230
|
port = _state.sent();
|
|
231
231
|
appContext = _object_spread_props(_object_spread({}, appContext), {
|
|
232
|
-
port,
|
|
232
|
+
port: port,
|
|
233
233
|
distDirectory: ensureAbsolutePath(appContext.distDirectory, ((_resolved_output_distPath = resolved.output.distPath) === null || _resolved_output_distPath === void 0 ? void 0 : _resolved_output_distPath.root) || "dist")
|
|
234
234
|
});
|
|
235
235
|
api.setAppContext(appContext);
|
|
236
236
|
normalizedConfig = checkIsLegacyConfig(resolved) ? transformNormalizedConfig(resolved) : resolved;
|
|
237
237
|
resolved._raw = userConfig;
|
|
238
238
|
resolved.server = _object_spread_props(_object_spread({}, normalizedConfig.server || {}), {
|
|
239
|
-
port
|
|
239
|
+
port: port
|
|
240
240
|
});
|
|
241
241
|
resolved.autoLoadPlugins = (_normalizedConfig_autoLoadPlugins = normalizedConfig.autoLoadPlugins) !== null && _normalizedConfig_autoLoadPlugins !== void 0 ? _normalizedConfig_autoLoadPlugins : false;
|
|
242
242
|
stabilizeConfig(resolved, normalizedConfig, [
|
|
@@ -261,7 +261,7 @@ export default function(param) {
|
|
|
261
261
|
return [
|
|
262
262
|
2,
|
|
263
263
|
{
|
|
264
|
-
resolved
|
|
264
|
+
resolved: resolved
|
|
265
265
|
}
|
|
266
266
|
];
|
|
267
267
|
}
|
|
@@ -285,11 +285,11 @@ function _getServerPort() {
|
|
|
285
285
|
_getServerPort = _async_to_generator(function(config) {
|
|
286
286
|
var prodPort;
|
|
287
287
|
return __generator(this, function(_state) {
|
|
288
|
-
prodPort = config.server.port || 8080;
|
|
288
|
+
prodPort = Number(process.env.PORT) || config.server.port || 8080;
|
|
289
289
|
if (isDev() && isDevCommand()) {
|
|
290
290
|
return [
|
|
291
291
|
2,
|
|
292
|
-
getPort(config.dev.port || prodPort)
|
|
292
|
+
getPort(Number(process.env.PORT) || config.dev.port || prodPort)
|
|
293
293
|
];
|
|
294
294
|
}
|
|
295
295
|
return [
|
|
@@ -58,7 +58,7 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
58
58
|
function _define_property(obj, key, value) {
|
|
59
59
|
if (key in obj) {
|
|
60
60
|
Object.defineProperty(obj, key, {
|
|
61
|
-
value,
|
|
61
|
+
value: value,
|
|
62
62
|
enumerable: true,
|
|
63
63
|
configurable: true,
|
|
64
64
|
writable: true
|
|
@@ -273,8 +273,8 @@ export var Schema = /* @__PURE__ */ function(Map1) {
|
|
|
273
273
|
return Object.entries(this.schema).map(function(param) {
|
|
274
274
|
var _param = _sliced_to_array(param, 2), target = _param[0], schema = _param[1];
|
|
275
275
|
return {
|
|
276
|
-
target,
|
|
277
|
-
schema
|
|
276
|
+
target: target,
|
|
277
|
+
schema: schema
|
|
278
278
|
};
|
|
279
279
|
});
|
|
280
280
|
}
|
package/dist/esm/schema/index.js
CHANGED