@modern-js/uni-builder 2.60.2 → 2.60.4
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.
|
@@ -82,7 +82,7 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
82
82
|
var _uniBuilderConfig_output, _uniBuilderConfig_tools;
|
|
83
83
|
var _rsbuildConfig_tools, _output, _output_distPath, _output1, _extraConfig, _html, _extraConfig1;
|
|
84
84
|
const { frameworkConfigPath } = options;
|
|
85
|
-
const { plugins: [...plugins] = [], performance: { ...performanceConfig } = {}, output: { disableFilenameHash, enableLatestDecorators, cssModuleLocalIdentName, enableInlineScripts, disableCssExtract, enableInlineStyles, enableCssModuleTSDeclaration, disableCssModuleExtension, disableTsChecker, disableSvgr, svgDefaultExport, assetsRetry, enableAssetFallback, enableAssetManifest, disableSourceMap, convertToRem, disableMinimize, polyfill, dataUriLimit = 1e4, distPath = {}, ...outputConfig } = {}, html: { disableHtmlFolder, metaByEntries, titleByEntries, faviconByEntries, injectByEntries, templateByEntries, templateParametersByEntries, tagsByEntries, appIcon, tags, ...htmlConfig } = {}, source: { alias, globalVars, resolveMainFields, resolveExtensionPrefix, transformImport, ...sourceConfig } = {}, dev, security: { checkSyntax, sri, ...securityConfig } = {}, tools: { devServer, tsChecker, minifyCss, less, sass, htmlPlugin, autoprefixer, ...toolsConfig } = {}, environments = {} } = uniBuilderConfig;
|
|
85
|
+
const { plugins: [...plugins] = [], performance: { ...performanceConfig } = {}, output: { disableFilenameHash, enableLatestDecorators, cssModuleLocalIdentName, enableInlineScripts, disableCssExtract, enableInlineStyles, enableCssModuleTSDeclaration, disableCssModuleExtension, disableTsChecker, disableSvgr, svgDefaultExport, assetsRetry, enableAssetFallback, enableAssetManifest, disableSourceMap, sourceMap, convertToRem, disableMinimize, polyfill, dataUriLimit = 1e4, distPath = {}, ...outputConfig } = {}, html: { disableHtmlFolder, metaByEntries, titleByEntries, faviconByEntries, injectByEntries, templateByEntries, templateParametersByEntries, tagsByEntries, outputStructure, appIcon, tags, ...htmlConfig } = {}, source: { alias, globalVars, resolveMainFields, resolveExtensionPrefix, transformImport, ...sourceConfig } = {}, dev, security: { checkSyntax, sri, ...securityConfig } = {}, tools: { devServer, tsChecker, minifyCss, less, sass, htmlPlugin, autoprefixer, ...toolsConfig } = {}, environments = {} } = uniBuilderConfig;
|
|
86
86
|
const rsbuildConfig = {
|
|
87
87
|
plugins,
|
|
88
88
|
output: {
|
|
@@ -158,7 +158,7 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
158
158
|
}
|
|
159
159
|
const extraConfig = {};
|
|
160
160
|
(_extraConfig = extraConfig).html || (_extraConfig.html = {});
|
|
161
|
-
extraConfig.html.outputStructure = disableHtmlFolder ? "flat" : "nested";
|
|
161
|
+
extraConfig.html.outputStructure = outputStructure !== null && outputStructure !== void 0 ? outputStructure : disableHtmlFolder ? "flat" : "nested";
|
|
162
162
|
if (metaByEntries) {
|
|
163
163
|
extraConfig.html.meta = ({ entryName }) => metaByEntries[entryName];
|
|
164
164
|
}
|
|
@@ -235,7 +235,8 @@ async function parseCommonConfig(uniBuilderConfig, options) {
|
|
|
235
235
|
(0, import_splitChunk.pluginSplitChunks)(),
|
|
236
236
|
(0, import_globalVars.pluginGlobalVars)(globalVars),
|
|
237
237
|
(0, import_devtools.pluginDevtool)({
|
|
238
|
-
disableSourceMap
|
|
238
|
+
disableSourceMap,
|
|
239
|
+
sourceMap
|
|
239
240
|
}),
|
|
240
241
|
(0, import_emitRouteFile.pluginEmitRouteFile)(),
|
|
241
242
|
(0, import_plugin_toml.pluginToml)(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
1
|
+
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
6
|
}) => RsbuildPlugin;
|
|
@@ -21,20 +21,32 @@ __export(devtools_exports, {
|
|
|
21
21
|
pluginDevtool: () => pluginDevtool
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(devtools_exports);
|
|
24
|
+
var import_utils = require("@modern-js/utils");
|
|
24
25
|
const isUseJsSourceMap = (disableSourceMap = {}) => {
|
|
25
|
-
|
|
26
|
+
if (typeof disableSourceMap === "boolean") {
|
|
27
|
+
return !disableSourceMap;
|
|
28
|
+
}
|
|
29
|
+
return !disableSourceMap.js;
|
|
26
30
|
};
|
|
27
31
|
const pluginDevtool = (options) => ({
|
|
28
32
|
name: "uni-builder:devtool",
|
|
29
33
|
setup(api) {
|
|
34
|
+
var _options_sourceMap;
|
|
35
|
+
const devtoolJs = (_options_sourceMap = options.sourceMap) === null || _options_sourceMap === void 0 ? void 0 : _options_sourceMap.js;
|
|
36
|
+
if (devtoolJs) {
|
|
37
|
+
if (!isUseJsSourceMap(options.disableSourceMap)) {
|
|
38
|
+
import_utils.logger.warn("Detected that `output.sourceMap` and `output.disableSourceMap` are used together, use the value of `output.sourceMap`");
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
30
42
|
api.modifyBundlerChain((chain, { isProd, isServer }) => {
|
|
31
43
|
if (!isUseJsSourceMap(options.disableSourceMap)) {
|
|
32
44
|
chain.devtool(false);
|
|
33
|
-
|
|
34
|
-
const prodDevTool = isServer ? "source-map" : "hidden-source-map";
|
|
35
|
-
const devtool = isProd ? prodDevTool : "cheap-module-source-map";
|
|
36
|
-
chain.devtool(devtool);
|
|
45
|
+
return;
|
|
37
46
|
}
|
|
47
|
+
const prodDevTool = isServer ? "source-map" : "hidden-source-map";
|
|
48
|
+
const devtool = isProd ? prodDevTool : "cheap-module-source-map";
|
|
49
|
+
chain.devtool(devtool);
|
|
38
50
|
});
|
|
39
51
|
}
|
|
40
52
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -238,6 +238,7 @@ export type UniBuilderExtraConfig = {
|
|
|
238
238
|
disableSvgr?: boolean;
|
|
239
239
|
/**
|
|
240
240
|
* Whether to disable source map.
|
|
241
|
+
* @deprecated use `output.sourceMap` instead
|
|
241
242
|
*/
|
|
242
243
|
disableSourceMap?: DisableSourceMapOption;
|
|
243
244
|
/**
|
|
@@ -320,6 +321,7 @@ export type SriOptions = {
|
|
|
320
321
|
export type OverridesUniBuilderInstance = {
|
|
321
322
|
addPlugins: (plugins: Array<UniBuilderPlugin | LooseRsbuildPlugin>, options?: {
|
|
322
323
|
before?: string;
|
|
324
|
+
environment?: string;
|
|
323
325
|
}) => void;
|
|
324
326
|
};
|
|
325
327
|
export type UniBuilderContext = RsbuildPluginAPI['context'] & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/uni-builder",
|
|
3
|
-
"version": "2.60.
|
|
3
|
+
"version": "2.60.4",
|
|
4
4
|
"description": "Unified builder for Modern.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,29 +25,29 @@
|
|
|
25
25
|
"@babel/core": "^7.24.7",
|
|
26
26
|
"@babel/preset-react": "^7.22.15",
|
|
27
27
|
"@babel/types": "^7.24.7",
|
|
28
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.
|
|
29
|
-
"@rsbuild/core": "1.0.
|
|
30
|
-
"@rsbuild/plugin-assets-retry": "1.0.1",
|
|
31
|
-
"@rsbuild/plugin-babel": "1.0.1",
|
|
32
|
-
"@rsbuild/plugin-check-syntax": "1.0.1",
|
|
33
|
-
"@rsbuild/plugin-css-minimizer": "1.0.2",
|
|
34
|
-
"@rsbuild/plugin-less": "1.0.1",
|
|
35
|
-
"@rsbuild/plugin-pug": "1.0.2",
|
|
36
|
-
"@rsbuild/plugin-react": "1.0.
|
|
37
|
-
"@rsbuild/plugin-rem": "1.0.1",
|
|
38
|
-
"@rsbuild/plugin-sass": "1.0.
|
|
39
|
-
"@rsbuild/plugin-source-build": "1.0.1",
|
|
40
|
-
"@rsbuild/plugin-styled-components": "1.0.1",
|
|
41
|
-
"@rsbuild/plugin-svgr": "1.0.
|
|
42
|
-
"@rsbuild/plugin-toml": "1.0.1",
|
|
43
|
-
"@rsbuild/plugin-type-check": "1.0.1",
|
|
44
|
-
"@rsbuild/plugin-typed-css-modules": "1.0.2",
|
|
45
|
-
"@rsbuild/plugin-yaml": "1.0.2",
|
|
46
|
-
"@rsbuild/webpack": "1.0.
|
|
28
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
29
|
+
"@rsbuild/core": "~1.0.11",
|
|
30
|
+
"@rsbuild/plugin-assets-retry": "~1.0.1",
|
|
31
|
+
"@rsbuild/plugin-babel": "~1.0.1",
|
|
32
|
+
"@rsbuild/plugin-check-syntax": "~1.0.1",
|
|
33
|
+
"@rsbuild/plugin-css-minimizer": "~1.0.2",
|
|
34
|
+
"@rsbuild/plugin-less": "~1.0.1",
|
|
35
|
+
"@rsbuild/plugin-pug": "~1.0.2",
|
|
36
|
+
"@rsbuild/plugin-react": "~1.0.3",
|
|
37
|
+
"@rsbuild/plugin-rem": "~1.0.1",
|
|
38
|
+
"@rsbuild/plugin-sass": "~1.0.2",
|
|
39
|
+
"@rsbuild/plugin-source-build": "~1.0.1",
|
|
40
|
+
"@rsbuild/plugin-styled-components": "~1.0.1",
|
|
41
|
+
"@rsbuild/plugin-svgr": "~1.0.3",
|
|
42
|
+
"@rsbuild/plugin-toml": "~1.0.1",
|
|
43
|
+
"@rsbuild/plugin-type-check": "~1.0.1",
|
|
44
|
+
"@rsbuild/plugin-typed-css-modules": "~1.0.2",
|
|
45
|
+
"@rsbuild/plugin-yaml": "~1.0.2",
|
|
46
|
+
"@rsbuild/webpack": "~1.0.9",
|
|
47
47
|
"@swc/helpers": "0.5.13",
|
|
48
|
-
"autoprefixer": "10.4.
|
|
48
|
+
"autoprefixer": "10.4.20",
|
|
49
49
|
"babel-loader": "9.1.3",
|
|
50
|
-
"babel-plugin-import": "1.13.
|
|
50
|
+
"babel-plugin-import": "1.13.8",
|
|
51
51
|
"babel-plugin-styled-components": "1.13.3",
|
|
52
52
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
|
53
53
|
"browserslist": "4.23.1",
|
|
@@ -66,25 +66,25 @@
|
|
|
66
66
|
"postcss-nesting": "12.0.1",
|
|
67
67
|
"postcss-page-break": "3.0.4",
|
|
68
68
|
"react-refresh": "^0.14.0",
|
|
69
|
-
"rspack-manifest-plugin": "5.0.
|
|
69
|
+
"rspack-manifest-plugin": "5.0.1",
|
|
70
70
|
"terser-webpack-plugin": "5.3.10",
|
|
71
|
-
"ts-deepmerge": "7.0.
|
|
71
|
+
"ts-deepmerge": "7.0.1",
|
|
72
72
|
"ts-loader": "9.4.4",
|
|
73
|
-
"webpack": "^5.
|
|
73
|
+
"webpack": "^5.95.0",
|
|
74
74
|
"webpack-subresource-integrity": "5.1.0",
|
|
75
|
-
"@modern-js/babel-preset": "2.60.
|
|
76
|
-
"@modern-js/utils": "2.60.
|
|
75
|
+
"@modern-js/babel-preset": "2.60.4",
|
|
76
|
+
"@modern-js/utils": "2.60.4"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@rsbuild/plugin-webpack-swc": "1.0.3",
|
|
79
|
+
"@rsbuild/plugin-webpack-swc": "~1.0.3",
|
|
80
80
|
"@types/html-minifier-terser": "^7.0.2",
|
|
81
81
|
"@types/lodash": "^4.14.202",
|
|
82
82
|
"react": "^18.2.0",
|
|
83
83
|
"react-dom": "^18.2.0",
|
|
84
84
|
"terser": "^5.31.1",
|
|
85
85
|
"typescript": "^5.3.0",
|
|
86
|
-
"@scripts/
|
|
87
|
-
"@scripts/
|
|
86
|
+
"@scripts/vitest-config": "2.60.4",
|
|
87
|
+
"@scripts/build": "2.60.4"
|
|
88
88
|
},
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public",
|