@modern-js/uni-builder 2.62.1 → 2.63.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/dist/rspack/index.js
CHANGED
|
@@ -84,11 +84,14 @@ async function createRspackBuilder(options) {
|
|
|
84
84
|
...rest,
|
|
85
85
|
cwd
|
|
86
86
|
});
|
|
87
|
+
rsbuildConfig.plugins = [
|
|
88
|
+
...rsbuildPlugins,
|
|
89
|
+
...rsbuildConfig.plugins || []
|
|
90
|
+
];
|
|
87
91
|
const rsbuild = await (0, import_core.createRsbuild)({
|
|
88
92
|
cwd,
|
|
89
93
|
rsbuildConfig
|
|
90
94
|
});
|
|
91
|
-
rsbuild.addPlugins(rsbuildPlugins);
|
|
92
95
|
return {
|
|
93
96
|
...rsbuild,
|
|
94
97
|
addPlugins: (plugins, options2) => {
|
|
@@ -88,6 +88,7 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
88
88
|
output: {
|
|
89
89
|
polyfill: polyfill === "ua" ? "off" : polyfill,
|
|
90
90
|
dataUriLimit,
|
|
91
|
+
sourceMap,
|
|
91
92
|
...outputConfig
|
|
92
93
|
},
|
|
93
94
|
source: {
|
|
@@ -127,7 +128,7 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
127
128
|
(_output3 = output).cssModules || (_output3.cssModules = {});
|
|
128
129
|
output.cssModules.localIdentName = cssModuleLocalIdentName;
|
|
129
130
|
}
|
|
130
|
-
if (isUseCssSourceMap(disableSourceMap)) {
|
|
131
|
+
if (isUseCssSourceMap(disableSourceMap) && output.sourceMap !== true) {
|
|
131
132
|
var _output4;
|
|
132
133
|
(_output4 = output).sourceMap || (_output4.sourceMap = {});
|
|
133
134
|
output.sourceMap.css = true;
|
|
@@ -259,7 +260,7 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
259
260
|
if (!disableTsChecker) {
|
|
260
261
|
const { pluginTypeCheck } = await Promise.resolve().then(() => __toESM(require("@rsbuild/plugin-type-check")));
|
|
261
262
|
rsbuildPlugins.push(pluginTypeCheck({
|
|
262
|
-
|
|
263
|
+
tsCheckerOptions: tsChecker
|
|
263
264
|
}));
|
|
264
265
|
}
|
|
265
266
|
if (resolveMainFields) {
|
|
@@ -2,5 +2,5 @@ import type { RsbuildPlugin, SourceMap } from '@rsbuild/core';
|
|
|
2
2
|
import type { DisableSourceMapOption } from '../../types';
|
|
3
3
|
export declare const pluginDevtool: (options: {
|
|
4
4
|
disableSourceMap?: DisableSourceMapOption;
|
|
5
|
-
sourceMap?: SourceMap;
|
|
5
|
+
sourceMap?: SourceMap | boolean;
|
|
6
6
|
}) => RsbuildPlugin;
|
|
@@ -32,9 +32,10 @@ const pluginDevtool = (options) => ({
|
|
|
32
32
|
name: "uni-builder:devtool",
|
|
33
33
|
setup(api) {
|
|
34
34
|
var _options_sourceMap;
|
|
35
|
-
const devtoolJs = (_options_sourceMap = options.sourceMap) === null || _options_sourceMap === void 0 ? void 0 : _options_sourceMap.js;
|
|
35
|
+
const devtoolJs = typeof options.sourceMap === "boolean" || ((_options_sourceMap = options.sourceMap) === null || _options_sourceMap === void 0 ? void 0 : _options_sourceMap.js) !== void 0;
|
|
36
36
|
if (devtoolJs) {
|
|
37
|
-
|
|
37
|
+
var _options_disableSourceMap;
|
|
38
|
+
if (typeof options.disableSourceMap === "boolean" || ((_options_disableSourceMap = options.disableSourceMap) === null || _options_disableSourceMap === void 0 ? void 0 : _options_disableSourceMap.js) !== void 0) {
|
|
38
39
|
import_utils.logger.warn("Detected that `output.sourceMap` and `output.disableSourceMap` are used together, use the value of `output.sourceMap`");
|
|
39
40
|
}
|
|
40
41
|
return;
|
package/dist/types.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export type UniBuilderExtraConfig = {
|
|
|
97
97
|
/**
|
|
98
98
|
* Modify the options of [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin).
|
|
99
99
|
*/
|
|
100
|
-
tsChecker?: PluginTypeCheckerOptions['
|
|
100
|
+
tsChecker?: PluginTypeCheckerOptions['tsCheckerOptions'];
|
|
101
101
|
/**
|
|
102
102
|
* Modify the options of [css-minimizer-webpack-plugin](https://github.com/webpack-contrib/css-minimizer-webpack-plugin).
|
|
103
103
|
*/
|
package/dist/webpack/index.js
CHANGED
|
@@ -40,7 +40,7 @@ var import_babel = require("./plugins/babel");
|
|
|
40
40
|
var import_moduleScopes = require("./plugins/moduleScopes");
|
|
41
41
|
var import_react = require("./plugins/react");
|
|
42
42
|
async function parseConfig(uniBuilderConfig, options) {
|
|
43
|
-
var _uniBuilderConfig_tools, _uniBuilderConfig_performance, _uniBuilderConfig_tools1, _uniBuilderConfig_output, _uniBuilderConfig_security, _uniBuilderConfig_experiments, _uniBuilderConfig_tools2;
|
|
43
|
+
var _uniBuilderConfig_tools, _uniBuilderConfig_performance, _uniBuilderConfig_tools1, _uniBuilderConfig_output, _uniBuilderConfig_security, _uniBuilderConfig_experiments, _uniBuilderConfig_tools2, _uniBuilderConfig_source;
|
|
44
44
|
const { rsbuildConfig, rsbuildPlugins } = await (0, import_parseCommonConfig.parseCommonConfig)(uniBuilderConfig, options);
|
|
45
45
|
var _uniBuilderConfig_performance_transformLodash;
|
|
46
46
|
rsbuildPlugins.push((0, import_babel.pluginBabel)({
|
|
@@ -77,13 +77,13 @@ async function parseConfig(uniBuilderConfig, options) {
|
|
|
77
77
|
}
|
|
78
78
|
rsbuildPlugins.push(pluginStyledComponents(options2));
|
|
79
79
|
}
|
|
80
|
+
rsbuildPlugins.push((0, import_moduleScopes.pluginModuleScopes)((_uniBuilderConfig_source = uniBuilderConfig.source) === null || _uniBuilderConfig_source === void 0 ? void 0 : _uniBuilderConfig_source.moduleScopes));
|
|
80
81
|
return {
|
|
81
82
|
rsbuildConfig,
|
|
82
83
|
rsbuildPlugins
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
async function createWebpackBuilder(options) {
|
|
86
|
-
var _options_config_source;
|
|
87
87
|
const { cwd = process.cwd(), config, ...rest } = options;
|
|
88
88
|
const { rsbuildConfig, rsbuildPlugins } = await parseConfig(config, {
|
|
89
89
|
...rest,
|
|
@@ -94,14 +94,14 @@ async function createWebpackBuilder(options) {
|
|
|
94
94
|
const { default: HtmlWebpackPlugin } = await Promise.resolve().then(() => __toESM(require("html-webpack-plugin")));
|
|
95
95
|
setHTMLPlugin(HtmlWebpackPlugin);
|
|
96
96
|
rsbuildConfig.provider = webpackProvider;
|
|
97
|
+
rsbuildConfig.plugins = [
|
|
98
|
+
...rsbuildPlugins,
|
|
99
|
+
...rsbuildConfig.plugins || []
|
|
100
|
+
];
|
|
97
101
|
const rsbuild = await (0, import_core.createRsbuild)({
|
|
98
102
|
rsbuildConfig,
|
|
99
103
|
cwd
|
|
100
104
|
});
|
|
101
|
-
rsbuild.addPlugins([
|
|
102
|
-
...rsbuildPlugins,
|
|
103
|
-
(0, import_moduleScopes.pluginModuleScopes)((_options_config_source = options.config.source) === null || _options_config_source === void 0 ? void 0 : _options_config_source.moduleScopes)
|
|
104
|
-
]);
|
|
105
105
|
return {
|
|
106
106
|
...rsbuild,
|
|
107
107
|
addPlugins: (plugins, options2) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/uni-builder",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.63.1",
|
|
4
4
|
"description": "Unified builder for Modern.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
"@babel/preset-react": "^7.22.15",
|
|
27
27
|
"@babel/types": "^7.26.0",
|
|
28
28
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
29
|
-
"@rsbuild/core": "
|
|
30
|
-
"@rsbuild/plugin-assets-retry": "
|
|
31
|
-
"@rsbuild/plugin-babel": "
|
|
32
|
-
"@rsbuild/plugin-check-syntax": "
|
|
33
|
-
"@rsbuild/plugin-css-minimizer": "
|
|
34
|
-
"@rsbuild/plugin-less": "
|
|
35
|
-
"@rsbuild/plugin-pug": "
|
|
36
|
-
"@rsbuild/plugin-react": "
|
|
37
|
-
"@rsbuild/plugin-rem": "
|
|
38
|
-
"@rsbuild/plugin-sass": "
|
|
39
|
-
"@rsbuild/plugin-source-build": "
|
|
40
|
-
"@rsbuild/plugin-styled-components": "
|
|
41
|
-
"@rsbuild/plugin-svgr": "
|
|
42
|
-
"@rsbuild/plugin-toml": "
|
|
43
|
-
"@rsbuild/plugin-type-check": "
|
|
44
|
-
"@rsbuild/plugin-typed-css-modules": "
|
|
45
|
-
"@rsbuild/plugin-yaml": "
|
|
46
|
-
"@rsbuild/webpack": "
|
|
29
|
+
"@rsbuild/core": "1.1.8",
|
|
30
|
+
"@rsbuild/plugin-assets-retry": "1.0.6",
|
|
31
|
+
"@rsbuild/plugin-babel": "1.0.3",
|
|
32
|
+
"@rsbuild/plugin-check-syntax": "1.1.0",
|
|
33
|
+
"@rsbuild/plugin-css-minimizer": "1.0.2",
|
|
34
|
+
"@rsbuild/plugin-less": "1.1.0",
|
|
35
|
+
"@rsbuild/plugin-pug": "1.0.2",
|
|
36
|
+
"@rsbuild/plugin-react": "1.0.7",
|
|
37
|
+
"@rsbuild/plugin-rem": "1.0.2",
|
|
38
|
+
"@rsbuild/plugin-sass": "1.1.1",
|
|
39
|
+
"@rsbuild/plugin-source-build": "1.0.1",
|
|
40
|
+
"@rsbuild/plugin-styled-components": "1.1.0",
|
|
41
|
+
"@rsbuild/plugin-svgr": "1.0.5",
|
|
42
|
+
"@rsbuild/plugin-toml": "1.0.1",
|
|
43
|
+
"@rsbuild/plugin-type-check": "1.1.0",
|
|
44
|
+
"@rsbuild/plugin-typed-css-modules": "1.0.2",
|
|
45
|
+
"@rsbuild/plugin-yaml": "1.0.2",
|
|
46
|
+
"@rsbuild/webpack": "1.1.4",
|
|
47
47
|
"@swc/helpers": "0.5.13",
|
|
48
48
|
"autoprefixer": "10.4.20",
|
|
49
49
|
"babel-loader": "9.1.3",
|
|
@@ -58,33 +58,33 @@
|
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
59
|
"picocolors": "^1.0.1",
|
|
60
60
|
"postcss": "^8.4.35",
|
|
61
|
-
"postcss-custom-properties": "13.
|
|
61
|
+
"postcss-custom-properties": "13.3.12",
|
|
62
62
|
"postcss-flexbugs-fixes": "5.0.2",
|
|
63
63
|
"postcss-font-variant": "5.0.0",
|
|
64
64
|
"postcss-initial": "4.0.1",
|
|
65
65
|
"postcss-media-minmax": "5.0.0",
|
|
66
|
-
"postcss-nesting": "12.
|
|
66
|
+
"postcss-nesting": "12.1.5",
|
|
67
67
|
"postcss-page-break": "3.0.4",
|
|
68
68
|
"react-refresh": "^0.14.0",
|
|
69
69
|
"rspack-manifest-plugin": "5.0.2",
|
|
70
70
|
"terser-webpack-plugin": "5.3.10",
|
|
71
|
-
"ts-deepmerge": "7.0.
|
|
71
|
+
"ts-deepmerge": "7.0.2",
|
|
72
72
|
"ts-loader": "9.4.4",
|
|
73
73
|
"webpack": "^5.96.1",
|
|
74
74
|
"webpack-subresource-integrity": "5.1.0",
|
|
75
|
-
"@modern-js/babel-preset": "2.
|
|
76
|
-
"@modern-js/utils": "2.
|
|
75
|
+
"@modern-js/babel-preset": "2.63.1",
|
|
76
|
+
"@modern-js/utils": "2.63.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@rsbuild/plugin-webpack-swc": "
|
|
79
|
+
"@rsbuild/plugin-webpack-swc": "1.0.9",
|
|
80
80
|
"@types/html-minifier-terser": "^7.0.2",
|
|
81
81
|
"@types/lodash": "^4.14.202",
|
|
82
82
|
"react": "^18.3.1",
|
|
83
83
|
"react-dom": "^18.3.1",
|
|
84
84
|
"terser": "^5.31.1",
|
|
85
85
|
"typescript": "^5.3.0",
|
|
86
|
-
"@scripts/vitest-config": "2.
|
|
87
|
-
"@scripts/build": "2.
|
|
86
|
+
"@scripts/vitest-config": "2.63.1",
|
|
87
|
+
"@scripts/build": "2.63.1"
|
|
88
88
|
},
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public",
|