@modern-js/app-tools 2.12.0 → 2.13.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 +89 -0
- package/dist/cjs/analyze/templates.js +8 -14
- package/dist/cjs/builder/builder-rspack/index.js +1 -22
- package/dist/cjs/builder/builder-webpack/index.js +0 -4
- package/dist/cjs/builder/generator/index.js +5 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +39 -2
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +20 -0
- package/dist/cjs/config/legacy/index.js +3 -2
- package/dist/cjs/defineConfig.js +8 -4
- package/dist/cjs/index.js +7 -4
- package/dist/cjs/initialize/index.js +14 -2
- package/dist/cjs/locale/index.js +1 -1
- package/dist/esm/analyze/templates.js +5 -6
- package/dist/esm/builder/builder-rspack/index.js +1 -169
- package/dist/esm/builder/builder-webpack/index.js +5 -20
- package/dist/esm/builder/generator/index.js +17 -1
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +216 -14
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +10 -0
- package/dist/esm/config/legacy/index.js +2 -2
- package/dist/esm/defineConfig.js +3 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/initialize/index.js +13 -2
- package/dist/esm/locale/index.js +1 -1
- package/dist/esm-node/analyze/templates.js +8 -14
- package/dist/esm-node/builder/builder-rspack/index.js +1 -12
- package/dist/esm-node/builder/builder-webpack/index.js +0 -4
- package/dist/esm-node/builder/generator/index.js +5 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +35 -3
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +10 -0
- package/dist/esm-node/config/legacy/index.js +3 -2
- package/dist/esm-node/defineConfig.js +8 -4
- package/dist/esm-node/index.js +4 -2
- package/dist/esm-node/initialize/index.js +14 -2
- package/dist/esm-node/locale/index.js +1 -1
- package/dist/types/builder/builder-rspack/index.d.ts +1 -2
- package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -1
- package/dist/types/defineConfig.d.ts +3 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +25 -24
- package/dist/cjs/utils/language.js +0 -31
- package/dist/esm/utils/language.js +0 -6
- package/dist/esm-node/utils/language.js +0 -8
- package/dist/types/utils/language.d.ts +0 -1
|
@@ -68,9 +68,6 @@ const html = (partials) => `
|
|
|
68
68
|
|
|
69
69
|
${partials.top.join("\n")}
|
|
70
70
|
|
|
71
|
-
<script>
|
|
72
|
-
window.__assetPrefix__ = '<%= assetPrefix %>';
|
|
73
|
-
</script>
|
|
74
71
|
${partials.head.join("\n")}
|
|
75
72
|
|
|
76
73
|
</head>
|
|
@@ -168,13 +165,10 @@ const fileSystemRoutes = async ({
|
|
|
168
165
|
if (!ssrMode) {
|
|
169
166
|
return "";
|
|
170
167
|
}
|
|
171
|
-
let dataLoaderPath = require.resolve("@modern-js/plugin-data-loader/loader");
|
|
172
168
|
if (nestedRoutesEntry) {
|
|
173
|
-
|
|
174
|
-
loadersMapFile
|
|
175
|
-
)}&loaderId=${loaderId}!`;
|
|
169
|
+
return `?mapFile=${slash(loadersMapFile)}&loaderId=${loaderId}`;
|
|
176
170
|
}
|
|
177
|
-
return
|
|
171
|
+
return "";
|
|
178
172
|
};
|
|
179
173
|
const traverseRouteTree = (route) => {
|
|
180
174
|
var _a;
|
|
@@ -292,14 +286,14 @@ const fileSystemRoutes = async ({
|
|
|
292
286
|
let importLoadersCode = "";
|
|
293
287
|
for (const [key, loaderInfo] of Object.entries(loadersMap)) {
|
|
294
288
|
if (loaderInfo.inline) {
|
|
295
|
-
importLoadersCode += `import { loader as ${key} } from "${
|
|
296
|
-
|
|
297
|
-
)}${
|
|
289
|
+
importLoadersCode += `import { loader as ${key} } from "${slash(
|
|
290
|
+
loaderInfo.filePath
|
|
291
|
+
)}${getDataLoaderPath(key)}";
|
|
298
292
|
`;
|
|
299
293
|
} else {
|
|
300
|
-
importLoadersCode += `import ${key} from "${
|
|
301
|
-
|
|
302
|
-
)}${
|
|
294
|
+
importLoadersCode += `import ${key} from "${slash(
|
|
295
|
+
loaderInfo.filePath
|
|
296
|
+
)}${getDataLoaderPath(key)}";
|
|
303
297
|
`;
|
|
304
298
|
}
|
|
305
299
|
}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { builderRspackProvider } from "@modern-js/builder-rspack-provider";
|
|
2
2
|
import { generateBuilder } from "../generator";
|
|
3
3
|
function createRspackBuilderForModern(options) {
|
|
4
|
-
return generateBuilder(options, builderRspackProvider
|
|
5
|
-
async modifyBuilderInstance(builder) {
|
|
6
|
-
applyBuilderPlugins(builder, options);
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
async function applyBuilderPlugins(builder, options) {
|
|
11
|
-
const { normalizedConfig } = options;
|
|
12
|
-
if (!normalizedConfig.output.disableNodePolyfill) {
|
|
13
|
-
const { builderPluginNodePolyfill } = await import("@modern-js/builder-plugin-node-polyfill");
|
|
14
|
-
builder.addPlugins([builderPluginNodePolyfill()]);
|
|
15
|
-
}
|
|
4
|
+
return generateBuilder(options, builderRspackProvider);
|
|
16
5
|
}
|
|
17
6
|
export {
|
|
18
7
|
createRspackBuilderForModern
|
|
@@ -29,10 +29,6 @@ function modifyOutputConfig(config, appContext) {
|
|
|
29
29
|
}
|
|
30
30
|
async function applyBuilderPlugins(builder, options) {
|
|
31
31
|
const { normalizedConfig } = options;
|
|
32
|
-
if (!normalizedConfig.output.disableNodePolyfill) {
|
|
33
|
-
const { builderPluginNodePolyfill } = await import("@modern-js/builder-plugin-node-polyfill");
|
|
34
|
-
builder.addPlugins([builderPluginNodePolyfill()]);
|
|
35
|
-
}
|
|
36
32
|
if (normalizedConfig.tools.esbuild) {
|
|
37
33
|
const { esbuild: esbuildOptions } = normalizedConfig.tools;
|
|
38
34
|
const { builderPluginEsbuild } = await import("@modern-js/builder-plugin-esbuild");
|
|
@@ -31,6 +31,11 @@ async function applyBuilderPlugins(builder, options) {
|
|
|
31
31
|
builderPluginAdapterSSR(options),
|
|
32
32
|
builderPluginAdapterHtml(options)
|
|
33
33
|
]);
|
|
34
|
+
const { normalizedConfig } = options;
|
|
35
|
+
if (!normalizedConfig.output.disableNodePolyfill) {
|
|
36
|
+
const { builderPluginNodePolyfill } = await import("@modern-js/builder-plugin-node-polyfill");
|
|
37
|
+
builder.addPlugins([builderPluginNodePolyfill()]);
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
export {
|
|
36
41
|
generateBuilder
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createVirtualModule
|
|
3
|
+
} from "@modern-js/builder-shared";
|
|
4
|
+
import {
|
|
5
|
+
getEntryOptions,
|
|
6
|
+
removeTailSlash
|
|
7
|
+
} from "@modern-js/utils";
|
|
2
8
|
import { template as lodashTemplate } from "@modern-js/utils/lodash";
|
|
3
9
|
import { BottomTemplatePlugin } from "../bundlerPlugins";
|
|
4
10
|
function isHtmlEnabled(config, target) {
|
|
@@ -6,10 +12,10 @@ function isHtmlEnabled(config, target) {
|
|
|
6
12
|
return ((_a = config.tools) == null ? void 0 : _a.htmlPlugin) !== false && target !== "node" && target !== "service-worker" && target !== "web-worker";
|
|
7
13
|
}
|
|
8
14
|
const builderPluginAdapterHtml = (options) => ({
|
|
9
|
-
name: "builder-plugin-
|
|
15
|
+
name: "builder-plugin-adapter-modern-html",
|
|
10
16
|
setup(api) {
|
|
11
17
|
api.modifyBundlerChain(
|
|
12
|
-
(chain, { CHAIN_ID, target, HtmlPlugin: HtmlBundlerPlugin }) => {
|
|
18
|
+
async (chain, { CHAIN_ID, target, HtmlPlugin: HtmlBundlerPlugin }) => {
|
|
13
19
|
const builderConfig = api.getNormalizedConfig();
|
|
14
20
|
if (isHtmlEnabled(builderConfig, target)) {
|
|
15
21
|
applyBottomHtmlPlugin({
|
|
@@ -19,11 +25,37 @@ const builderPluginAdapterHtml = (options) => ({
|
|
|
19
25
|
CHAIN_ID,
|
|
20
26
|
HtmlBundlerPlugin
|
|
21
27
|
});
|
|
28
|
+
await injectAssetPrefix({
|
|
29
|
+
api,
|
|
30
|
+
chain
|
|
31
|
+
});
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
34
|
);
|
|
25
35
|
}
|
|
26
36
|
});
|
|
37
|
+
async function injectAssetPrefix({
|
|
38
|
+
api,
|
|
39
|
+
chain
|
|
40
|
+
}) {
|
|
41
|
+
const entries = chain.entryPoints.entries() || {};
|
|
42
|
+
const entryNames = Object.keys(entries);
|
|
43
|
+
const assetPrefix = removeTailSlash(chain.output.get("publicPath") || "");
|
|
44
|
+
const code = `window.__assetPrefix__ = '${assetPrefix}';`;
|
|
45
|
+
const isRspack = api.context.bundlerType === "rspack";
|
|
46
|
+
if (isRspack) {
|
|
47
|
+
const fileName = "rspack-asset-prefix";
|
|
48
|
+
const { default: RspackVirtualModulePlugin } = await import("rspack-plugin-virtual-module");
|
|
49
|
+
entryNames.forEach((entryName) => {
|
|
50
|
+
entries[entryName].prepend(fileName);
|
|
51
|
+
chain.plugin("rspack-asset-prefix").use(RspackVirtualModulePlugin, [{ [fileName]: code }]);
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
entryNames.forEach((entryName) => {
|
|
55
|
+
entries[entryName].prepend(createVirtualModule(code));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
27
59
|
function applyBottomHtmlPlugin({
|
|
28
60
|
api,
|
|
29
61
|
chain,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as path from "path";
|
|
1
2
|
import {
|
|
2
3
|
mergeBuilderConfig
|
|
3
4
|
} from "@modern-js/builder-shared";
|
|
@@ -26,6 +27,7 @@ const builderPluginAdapterSSR = (options) => ({
|
|
|
26
27
|
applyRouterPlugin(chain, options);
|
|
27
28
|
if (isSSR(normalizedConfig2)) {
|
|
28
29
|
await applySSRLoaderEntry(chain, options, isServer);
|
|
30
|
+
applySSRDataLoader(chain, options);
|
|
29
31
|
}
|
|
30
32
|
if (["node", "service-worker"].includes(target)) {
|
|
31
33
|
applyFilterEntriesBySSRConfig({
|
|
@@ -141,6 +143,14 @@ async function applySSRLoaderEntry(chain, optinos, isServer) {
|
|
|
141
143
|
})
|
|
142
144
|
);
|
|
143
145
|
}
|
|
146
|
+
function applySSRDataLoader(chain, options) {
|
|
147
|
+
const { normalizedConfig, appContext } = options;
|
|
148
|
+
const { appDirectory } = appContext;
|
|
149
|
+
const { entriesDir = "./src" } = normalizedConfig.source;
|
|
150
|
+
const absolutePath = path.resolve(appDirectory, entriesDir);
|
|
151
|
+
const reg = new RegExp(`${absolutePath}.*\\.loader\\.[t|j]s$`);
|
|
152
|
+
chain.module.rule("ssr-data-loader").test(reg).use("data-loader").loader(require.resolve("@modern-js/plugin-data-loader/loader")).end();
|
|
153
|
+
}
|
|
144
154
|
export {
|
|
145
155
|
builderPluginAdapterSSR
|
|
146
156
|
};
|
|
@@ -16,7 +16,8 @@ function transformNormalizedConfig(config) {
|
|
|
16
16
|
server,
|
|
17
17
|
cliOptions,
|
|
18
18
|
plugins,
|
|
19
|
-
testing
|
|
19
|
+
testing,
|
|
20
|
+
autoLoadPlugins
|
|
20
21
|
} = config;
|
|
21
22
|
return {
|
|
22
23
|
source,
|
|
@@ -36,7 +37,7 @@ function transformNormalizedConfig(config) {
|
|
|
36
37
|
security: {},
|
|
37
38
|
_raw: {},
|
|
38
39
|
experiments: {},
|
|
39
|
-
autoLoadPlugins
|
|
40
|
+
autoLoadPlugins,
|
|
40
41
|
performance: {
|
|
41
42
|
removeMomentLocale: true
|
|
42
43
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
const defineConfig = (config) => config;
|
|
2
|
-
const defineLegacyConfig = (config) =>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const defineLegacyConfig = (config) => {
|
|
3
|
+
var _a;
|
|
4
|
+
return {
|
|
5
|
+
...config,
|
|
6
|
+
legacy: true,
|
|
7
|
+
autoLoadPlugins: (_a = config.autoLoadPlugins) != null ? _a : true
|
|
8
|
+
};
|
|
9
|
+
};
|
|
6
10
|
export {
|
|
7
11
|
defineConfig,
|
|
8
12
|
defineLegacyConfig
|
package/dist/esm-node/index.js
CHANGED
|
@@ -7,13 +7,14 @@ import {
|
|
|
7
7
|
getCommand
|
|
8
8
|
} from "@modern-js/utils";
|
|
9
9
|
import { castArray } from "@modern-js/utils/lodash";
|
|
10
|
+
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
|
10
11
|
import analyzePlugin from "./analyze";
|
|
11
12
|
import initializePlugin from "./initialize";
|
|
12
13
|
import { hooks } from "./hooks";
|
|
13
14
|
import { i18n, localeKeys } from "./locale";
|
|
14
|
-
import { getLocaleLanguage } from "./utils/language";
|
|
15
15
|
import { restart } from "./utils/restart";
|
|
16
16
|
import { generateWatchFiles } from "./utils/generateWatchFiles";
|
|
17
|
+
import { mergeConfig } from "@modern-js/core";
|
|
17
18
|
export * from "./defineConfig";
|
|
18
19
|
export * from "./types";
|
|
19
20
|
const upgradeModel = Import.lazy(
|
|
@@ -169,5 +170,6 @@ var src_default = (options = {
|
|
|
169
170
|
export {
|
|
170
171
|
buildCommand,
|
|
171
172
|
src_default as default,
|
|
172
|
-
devCommand
|
|
173
|
+
devCommand,
|
|
174
|
+
mergeConfig
|
|
173
175
|
};
|
|
@@ -15,10 +15,22 @@ var initialize_default = ({
|
|
|
15
15
|
bundler
|
|
16
16
|
}) => ({
|
|
17
17
|
name: "@modern-js/plugin-initialize",
|
|
18
|
+
post: [
|
|
19
|
+
"@modern-js/plugin-ssr",
|
|
20
|
+
"@modern-js/plugin-document",
|
|
21
|
+
"@modern-js/plugin-state",
|
|
22
|
+
"@modern-js/plugin-router",
|
|
23
|
+
"@modern-js/plugin-router-v5",
|
|
24
|
+
"@modern-js/plugin-polyfill"
|
|
25
|
+
],
|
|
18
26
|
setup(api) {
|
|
19
27
|
const config = () => {
|
|
20
28
|
const appContext = api.useAppContext();
|
|
21
29
|
const userConfig = api.useConfigContext();
|
|
30
|
+
api.setAppContext({
|
|
31
|
+
...appContext,
|
|
32
|
+
bundlerType: bundler
|
|
33
|
+
});
|
|
22
34
|
return checkIsLegacyConfig(userConfig) ? createLegacyDefaultConfig(appContext) : createDefaultConfig(appContext, bundler);
|
|
23
35
|
};
|
|
24
36
|
const validateSchema = () => {
|
|
@@ -30,7 +42,7 @@ var initialize_default = ({
|
|
|
30
42
|
config,
|
|
31
43
|
validateSchema,
|
|
32
44
|
async resolvedConfig({ resolved }) {
|
|
33
|
-
var _a;
|
|
45
|
+
var _a, _b;
|
|
34
46
|
let appContext = api.useAppContext();
|
|
35
47
|
const userConfig = api.useConfigContext();
|
|
36
48
|
const port = await getServerPort(resolved);
|
|
@@ -49,7 +61,7 @@ var initialize_default = ({
|
|
|
49
61
|
...normalizedConfig.server || {},
|
|
50
62
|
port
|
|
51
63
|
};
|
|
52
|
-
resolved.autoLoadPlugins = normalizedConfig.autoLoadPlugins
|
|
64
|
+
resolved.autoLoadPlugins = (_b = normalizedConfig.autoLoadPlugins) != null ? _b : false;
|
|
53
65
|
stabilizeConfig(resolved, normalizedConfig, [
|
|
54
66
|
"source",
|
|
55
67
|
"bff",
|
|
@@ -2,7 +2,7 @@ import { I18n } from "@modern-js/plugin-i18n";
|
|
|
2
2
|
import { ZH_LOCALE } from "./zh";
|
|
3
3
|
import { EN_LOCALE } from "./en";
|
|
4
4
|
const i18n = new I18n();
|
|
5
|
-
const localeKeys = i18n.init("
|
|
5
|
+
const localeKeys = i18n.init("en", { zh: ZH_LOCALE, en: EN_LOCALE });
|
|
6
6
|
export {
|
|
7
7
|
i18n,
|
|
8
8
|
localeKeys
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { BuilderInstance } from '@modern-js/builder-shared';
|
|
2
1
|
import { BuilderOptions } from '../shared';
|
|
3
|
-
export declare function createRspackBuilderForModern(options: BuilderOptions<'rspack'>): Promise<BuilderInstance<import("@modern-js/builder-shared").BuilderProvider<Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>>>;
|
|
2
|
+
export declare function createRspackBuilderForModern(options: BuilderOptions<'rspack'>): Promise<import("@modern-js/builder-shared").BuilderInstance<import("@modern-js/builder-shared").BuilderProvider<Record<string, any>, Record<string, any>, Record<string, any>, Record<string, any>>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BuilderPlugin, BuilderTarget } from '@modern-js/builder-shared';
|
|
2
2
|
import { Bundler } from '../../../types';
|
|
3
3
|
import type { BuilderNormalizedConfig, BuilderOptions, BuilderPluginAPI } from '../types';
|
|
4
4
|
export declare function isHtmlEnabled(config: BuilderNormalizedConfig, target: BuilderTarget): boolean;
|
|
@@ -2,8 +2,9 @@ import type { UserConfigExport } from '@modern-js/core';
|
|
|
2
2
|
import type { AppLegacyUserConfig, AppUserConfig } from './types';
|
|
3
3
|
export declare const defineConfig: <B extends "webpack" | "rspack" = "webpack">(config: UserConfigExport<AppUserConfig<B>>) => UserConfigExport<AppUserConfig<B>>;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Recommend use `defineConfig` first.
|
|
6
|
+
*
|
|
7
|
+
* `defineLegacyConfig` will be deprecated in the future.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
export declare const defineLegacyConfig: (config: AppLegacyUserConfig) => AppLegacyUserConfig;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from '@modern-js/utils';
|
|
2
2
|
import { CliPlugin, PluginAPI } from '@modern-js/core';
|
|
3
3
|
import { AppTools } from './types';
|
|
4
|
+
export { mergeConfig } from '@modern-js/core';
|
|
4
5
|
export * from './defineConfig';
|
|
5
6
|
export * from './types';
|
|
6
7
|
export type { RuntimeUserConfig } from './types/config';
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.13.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/cjs/index.js",
|
|
@@ -68,23 +68,24 @@
|
|
|
68
68
|
"@babel/types": "^7.18.0",
|
|
69
69
|
"es-module-lexer": "^1.1.0",
|
|
70
70
|
"esbuild": "0.15.7",
|
|
71
|
-
"
|
|
72
|
-
"@modern-js/builder
|
|
73
|
-
"@modern-js/builder-plugin-
|
|
74
|
-
"@modern-js/builder-
|
|
75
|
-
"@modern-js/builder-
|
|
76
|
-
"@modern-js/
|
|
77
|
-
"@modern-js/
|
|
78
|
-
"@modern-js/
|
|
79
|
-
"@modern-js/
|
|
80
|
-
"@modern-js/plugin
|
|
81
|
-
"@modern-js/plugin-
|
|
82
|
-
"@modern-js/plugin-
|
|
83
|
-
"@modern-js/
|
|
84
|
-
"@modern-js/server": "2.
|
|
85
|
-
"@modern-js/
|
|
86
|
-
"@modern-js/
|
|
87
|
-
"@modern-js/
|
|
71
|
+
"rspack-plugin-virtual-module": "0.1.0",
|
|
72
|
+
"@modern-js/builder": "2.13.1",
|
|
73
|
+
"@modern-js/builder-plugin-esbuild": "2.13.1",
|
|
74
|
+
"@modern-js/builder-plugin-node-polyfill": "2.13.1",
|
|
75
|
+
"@modern-js/builder-shared": "2.13.1",
|
|
76
|
+
"@modern-js/builder-webpack-provider": "2.13.1",
|
|
77
|
+
"@modern-js/core": "2.13.1",
|
|
78
|
+
"@modern-js/new-action": "2.13.1",
|
|
79
|
+
"@modern-js/node-bundle-require": "2.13.1",
|
|
80
|
+
"@modern-js/plugin": "2.13.1",
|
|
81
|
+
"@modern-js/plugin-data-loader": "2.13.1",
|
|
82
|
+
"@modern-js/plugin-i18n": "2.13.1",
|
|
83
|
+
"@modern-js/plugin-lint": "2.13.1",
|
|
84
|
+
"@modern-js/prod-server": "2.13.1",
|
|
85
|
+
"@modern-js/server": "2.13.1",
|
|
86
|
+
"@modern-js/types": "2.13.1",
|
|
87
|
+
"@modern-js/upgrade": "2.13.1",
|
|
88
|
+
"@modern-js/utils": "2.13.1"
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": {
|
|
90
91
|
"@types/babel__traverse": "^7.14.2",
|
|
@@ -93,14 +94,14 @@
|
|
|
93
94
|
"jest": "^29",
|
|
94
95
|
"typescript": "^4",
|
|
95
96
|
"webpack": "^5.76.2",
|
|
96
|
-
"@modern-js/builder-plugin-swc": "2.
|
|
97
|
-
"@modern-js/builder-rspack-provider": "2.
|
|
98
|
-
"@modern-js/server-core": "2.
|
|
99
|
-
"@scripts/build": "2.
|
|
100
|
-
"@scripts/jest-config": "2.
|
|
97
|
+
"@modern-js/builder-plugin-swc": "2.13.1",
|
|
98
|
+
"@modern-js/builder-rspack-provider": "2.13.1",
|
|
99
|
+
"@modern-js/server-core": "2.13.1",
|
|
100
|
+
"@scripts/build": "2.13.1",
|
|
101
|
+
"@scripts/jest-config": "2.13.1"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
|
-
"@modern-js/builder-rspack-provider": "^2.
|
|
104
|
+
"@modern-js/builder-rspack-provider": "^2.13.1"
|
|
104
105
|
},
|
|
105
106
|
"peerDependenciesMeta": {
|
|
106
107
|
"@modern-js/builder-rspack-provider": {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 language_exports = {};
|
|
19
|
-
__export(language_exports, {
|
|
20
|
-
getLocaleLanguage: () => getLocaleLanguage
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(language_exports);
|
|
23
|
-
var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
|
|
24
|
-
function getLocaleLanguage() {
|
|
25
|
-
const detector = new import_language_detector.I18CLILanguageDetector();
|
|
26
|
-
return detector.detect();
|
|
27
|
-
}
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
getLocaleLanguage
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getLocaleLanguage(): string;
|