@modern-js/app-tools 2.70.7 → 2.71.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/dist/cjs/builder/generator/createBuilderProviderConfig.js +7 -1
- package/dist/cjs/config/default.js +1 -0
- package/dist/esm/builder/generator/createBuilderProviderConfig.js +5 -1
- package/dist/esm/config/default.js +1 -0
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.js +7 -1
- package/dist/esm-node/config/default.js +1 -0
- package/dist/types/types/config/source.d.ts +14 -0
- package/package.json +16 -16
|
@@ -37,7 +37,7 @@ function modifyOutputConfig(config, appContext) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
40
|
-
var _resolveConfig_tools;
|
|
40
|
+
var _resolveConfig_tools, _config_source, _config_source1;
|
|
41
41
|
const htmlConfig = {
|
|
42
42
|
...resolveConfig.html
|
|
43
43
|
};
|
|
@@ -53,6 +53,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
|
53
53
|
resolve: {
|
|
54
54
|
...resolveConfig.resolve
|
|
55
55
|
},
|
|
56
|
+
source: {
|
|
57
|
+
...resolveConfig.source
|
|
58
|
+
},
|
|
56
59
|
dev: {
|
|
57
60
|
...resolveConfig.dev,
|
|
58
61
|
port: appContext.port
|
|
@@ -82,6 +85,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
|
82
85
|
}
|
|
83
86
|
}
|
|
84
87
|
};
|
|
88
|
+
if (((_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.enableAsyncEntry) && ((_config_source1 = config.source) === null || _config_source1 === void 0 ? void 0 : _config_source1.enableAsyncPreEntry)) {
|
|
89
|
+
delete config.source.preEntry;
|
|
90
|
+
}
|
|
85
91
|
modifyOutputConfig(config, appContext);
|
|
86
92
|
return config;
|
|
87
93
|
}
|
|
@@ -15,7 +15,7 @@ function modifyOutputConfig(config, appContext) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
18
|
-
var _resolveConfig_tools;
|
|
18
|
+
var _resolveConfig_tools, _config_source, _config_source1;
|
|
19
19
|
var htmlConfig = _object_spread({}, resolveConfig.html);
|
|
20
20
|
if (!htmlConfig.template) {
|
|
21
21
|
htmlConfig.templateByEntries = _object_spread({}, appContext.htmlTemplates, htmlConfig.templateByEntries);
|
|
@@ -23,6 +23,7 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
|
23
23
|
var config = _object_spread_props(_object_spread({}, resolveConfig), {
|
|
24
24
|
plugins: [],
|
|
25
25
|
resolve: _object_spread({}, resolveConfig.resolve),
|
|
26
|
+
source: _object_spread({}, resolveConfig.source),
|
|
26
27
|
dev: _object_spread_props(_object_spread({}, resolveConfig.dev), {
|
|
27
28
|
port: appContext.port
|
|
28
29
|
}),
|
|
@@ -48,6 +49,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
|
48
49
|
})
|
|
49
50
|
})
|
|
50
51
|
});
|
|
52
|
+
if (((_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.enableAsyncEntry) && ((_config_source1 = config.source) === null || _config_source1 === void 0 ? void 0 : _config_source1.enableAsyncPreEntry)) {
|
|
53
|
+
delete config.source.preEntry;
|
|
54
|
+
}
|
|
51
55
|
modifyOutputConfig(config, appContext);
|
|
52
56
|
return config;
|
|
53
57
|
}
|
|
@@ -14,7 +14,7 @@ function modifyOutputConfig(config, appContext) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
17
|
-
var _resolveConfig_tools;
|
|
17
|
+
var _resolveConfig_tools, _config_source, _config_source1;
|
|
18
18
|
const htmlConfig = {
|
|
19
19
|
...resolveConfig.html
|
|
20
20
|
};
|
|
@@ -30,6 +30,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
|
30
30
|
resolve: {
|
|
31
31
|
...resolveConfig.resolve
|
|
32
32
|
},
|
|
33
|
+
source: {
|
|
34
|
+
...resolveConfig.source
|
|
35
|
+
},
|
|
33
36
|
dev: {
|
|
34
37
|
...resolveConfig.dev,
|
|
35
38
|
port: appContext.port
|
|
@@ -59,6 +62,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
64
|
};
|
|
65
|
+
if (((_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.enableAsyncEntry) && ((_config_source1 = config.source) === null || _config_source1 === void 0 ? void 0 : _config_source1.enableAsyncPreEntry)) {
|
|
66
|
+
delete config.source.preEntry;
|
|
67
|
+
}
|
|
62
68
|
modifyOutputConfig(config, appContext);
|
|
63
69
|
return config;
|
|
64
70
|
}
|
|
@@ -21,6 +21,11 @@ export type Entry = string | {
|
|
|
21
21
|
};
|
|
22
22
|
export type Entries = Record<string, Entry>;
|
|
23
23
|
export interface SourceUserConfig extends NonNullable<UniBuilderConfig['source']> {
|
|
24
|
+
/**
|
|
25
|
+
* Add code before each page entry. It will be executed before the page code.
|
|
26
|
+
* @default []
|
|
27
|
+
*/
|
|
28
|
+
preEntry?: string | string[];
|
|
24
29
|
/**
|
|
25
30
|
* Used to configure custom page entries.
|
|
26
31
|
*/
|
|
@@ -36,6 +41,15 @@ export interface SourceUserConfig extends NonNullable<UniBuilderConfig['source']
|
|
|
36
41
|
* @default false
|
|
37
42
|
*/
|
|
38
43
|
enableAsyncEntry?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* When enabled, framework will inject `source.preEntry` into the top of the
|
|
46
|
+
* auto-generated entry file (`index.jsx`) and will not pass `source.preEntry`
|
|
47
|
+
* to builder config.
|
|
48
|
+
* This is useful when `source.enableAsyncEntry` is enabled and you still want
|
|
49
|
+
* preEntry to run before the real entry code.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
enableAsyncPreEntry?: boolean;
|
|
39
53
|
/**
|
|
40
54
|
* Enable use entry.tsx to custom entry
|
|
41
55
|
* @default false
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.71.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@babel/parser": "^7.22.15",
|
|
86
86
|
"@babel/traverse": "^7.23.2",
|
|
87
87
|
"@babel/types": "^7.26.0",
|
|
88
|
-
"@rsbuild/core": "1.7.
|
|
88
|
+
"@rsbuild/core": "1.7.5",
|
|
89
89
|
"@rsbuild/plugin-node-polyfill": "1.4.4",
|
|
90
90
|
"@swc/helpers": "^0.5.17",
|
|
91
91
|
"es-module-lexer": "^1.1.0",
|
|
@@ -96,20 +96,20 @@
|
|
|
96
96
|
"ndepe": "^0.1.13",
|
|
97
97
|
"pkg-types": "^1.3.1",
|
|
98
98
|
"std-env": "^3.7.0",
|
|
99
|
-
"@modern-js/core": "2.
|
|
100
|
-
"@modern-js/node-bundle-require": "2.
|
|
101
|
-
"@modern-js/plugin": "2.
|
|
102
|
-
"@modern-js/plugin-data-loader": "2.
|
|
103
|
-
"@modern-js/plugin-i18n": "2.
|
|
104
|
-
"@modern-js/
|
|
105
|
-
"@modern-js/
|
|
106
|
-
"@modern-js/
|
|
107
|
-
"@modern-js/server": "2.
|
|
108
|
-
"@modern-js/server-core": "2.
|
|
109
|
-
"@modern-js/server-utils": "2.
|
|
110
|
-
"@modern-js/types": "2.
|
|
111
|
-
"@modern-js/uni-builder": "2.
|
|
112
|
-
"@modern-js/utils": "2.
|
|
99
|
+
"@modern-js/core": "2.71.0",
|
|
100
|
+
"@modern-js/node-bundle-require": "2.71.0",
|
|
101
|
+
"@modern-js/plugin": "2.71.0",
|
|
102
|
+
"@modern-js/plugin-data-loader": "2.71.0",
|
|
103
|
+
"@modern-js/plugin-i18n": "2.71.0",
|
|
104
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.71.0",
|
|
105
|
+
"@modern-js/prod-server": "2.71.0",
|
|
106
|
+
"@modern-js/plugin-v2": "2.71.0",
|
|
107
|
+
"@modern-js/server": "2.71.0",
|
|
108
|
+
"@modern-js/server-core": "2.71.0",
|
|
109
|
+
"@modern-js/server-utils": "2.71.0",
|
|
110
|
+
"@modern-js/types": "2.71.0",
|
|
111
|
+
"@modern-js/uni-builder": "2.71.0",
|
|
112
|
+
"@modern-js/utils": "2.71.0"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@rsbuild/plugin-webpack-swc": "1.1.2",
|