@modern-js/uni-builder 2.64.3 → 2.65.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.
@@ -39,6 +39,11 @@ var import_rsbuild_rsc_plugin = require("../shared/rsc/plugins/rsbuild-rsc-plugi
39
39
  var import_utils = require("../shared/utils");
40
40
  async function parseConfig(uniBuilderConfig, options) {
41
41
  var _uniBuilderConfig_experiments, _uniBuilderConfig_tools, _uniBuilderConfig_tools1, _uniBuilderConfig_server;
42
+ var _uniBuilderConfig, _uniBuilderConfig_performance;
43
+ var _performance;
44
+ (_performance = (_uniBuilderConfig = uniBuilderConfig).performance) !== null && _performance !== void 0 ? _performance : _uniBuilderConfig.performance = {};
45
+ var _buildCache;
46
+ (_buildCache = (_uniBuilderConfig_performance = uniBuilderConfig.performance).buildCache) !== null && _buildCache !== void 0 ? _buildCache : _uniBuilderConfig_performance.buildCache = false;
42
47
  const { rsbuildConfig, rsbuildPlugins } = await (0, import_parseCommonConfig.parseCommonConfig)(uniBuilderConfig, options);
43
48
  if ((_uniBuilderConfig_experiments = uniBuilderConfig.experiments) === null || _uniBuilderConfig_experiments === void 0 ? void 0 : _uniBuilderConfig_experiments.lazyCompilation) {
44
49
  rsbuildConfig.dev.lazyCompilation = uniBuilderConfig.experiments.lazyCompilation;
@@ -46,7 +46,6 @@ var import_arco = require("./plugins/arco");
46
46
  var import_devtools = require("./plugins/devtools");
47
47
  var import_emitRouteFile = require("./plugins/emitRouteFile");
48
48
  var import_environmentDefaults = require("./plugins/environmentDefaults");
49
- var import_frameworkConfig = require("./plugins/frameworkConfig");
50
49
  var import_globalVars = require("./plugins/globalVars");
51
50
  var import_htmlMinify = require("./plugins/htmlMinify");
52
51
  var import_runtimeChunk = require("./plugins/runtimeChunk");
@@ -148,7 +147,9 @@ async function parseCommonConfig(uniBuilderConfig, options) {
148
147
  output.inlineScripts = enableInlineScripts;
149
148
  }
150
149
  if (disableCssExtract) {
151
- output.injectStyles = disableCssExtract;
150
+ var _output6;
151
+ var _injectStyles;
152
+ (_injectStyles = (_output6 = output).injectStyles) !== null && _injectStyles !== void 0 ? _injectStyles : _output6.injectStyles = disableCssExtract;
152
153
  }
153
154
  if (enableInlineStyles) {
154
155
  output.inlineStyles = enableInlineStyles;
@@ -309,8 +310,15 @@ async function parseCommonConfig(uniBuilderConfig, options) {
309
310
  const { pluginFallback } = await Promise.resolve().then(() => __toESM(require("./plugins/fallback")));
310
311
  rsbuildPlugins.push(pluginFallback());
311
312
  }
312
- if (frameworkConfigPath) {
313
- rsbuildPlugins.push((0, import_frameworkConfig.pluginFrameworkConfig)(frameworkConfigPath));
313
+ if (frameworkConfigPath && performanceConfig.buildCache !== false) {
314
+ const buildCache = typeof performanceConfig.buildCache === "object" ? performanceConfig.buildCache : {};
315
+ rsbuildConfig.performance.buildCache = {
316
+ ...buildCache,
317
+ buildDependencies: [
318
+ frameworkConfigPath,
319
+ ...buildCache.buildDependencies || []
320
+ ]
321
+ };
314
322
  }
315
323
  rsbuildPlugins.push((0, import_plugin_css_minimizer.pluginCssMinimizer)({
316
324
  pluginOptions: minifyCss
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/uni-builder",
3
- "version": "2.64.3",
3
+ "version": "2.65.0",
4
4
  "description": "Unified builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -79,9 +79,9 @@
79
79
  "ts-loader": "9.4.4",
80
80
  "webpack": "^5.98.0",
81
81
  "webpack-subresource-integrity": "5.1.0",
82
- "@modern-js/babel-preset": "2.64.3",
83
- "@modern-js/flight-server-transform-plugin": "2.64.3",
84
- "@modern-js/utils": "2.64.3"
82
+ "@modern-js/babel-preset": "2.65.0",
83
+ "@modern-js/flight-server-transform-plugin": "2.65.0",
84
+ "@modern-js/utils": "2.65.0"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@rsbuild/plugin-webpack-swc": "1.0.9",
@@ -92,9 +92,9 @@
92
92
  "react-dom": "^18.2.0",
93
93
  "terser": "^5.31.1",
94
94
  "typescript": "^5.3.0",
95
- "@modern-js/types": "2.64.3",
96
- "@scripts/build": "2.64.3",
97
- "@scripts/vitest-config": "2.64.3"
95
+ "@modern-js/types": "2.65.0",
96
+ "@scripts/build": "2.65.0",
97
+ "@scripts/vitest-config": "2.65.0"
98
98
  },
99
99
  "publishConfig": {
100
100
  "access": "public",
@@ -1,2 +0,0 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
2
- export declare const pluginFrameworkConfig: (configPath: string) => RsbuildPlugin;
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var frameworkConfig_exports = {};
30
- __export(frameworkConfig_exports, {
31
- pluginFrameworkConfig: () => pluginFrameworkConfig
32
- });
33
- module.exports = __toCommonJS(frameworkConfig_exports);
34
- var import_node_fs = __toESM(require("node:fs"));
35
- const pluginFrameworkConfig = (configPath) => ({
36
- name: "uni-builder:framework-config",
37
- setup(api) {
38
- api.modifyBundlerChain((chain) => {
39
- if (!import_node_fs.default.existsSync(configPath) || api.context.bundlerType !== "webpack") {
40
- return;
41
- }
42
- const cache = chain.get("cache");
43
- if (!cache) {
44
- return;
45
- }
46
- if (cache === true) {
47
- chain.cache({
48
- buildDependencies: {
49
- frameworkConfig: [
50
- configPath
51
- ]
52
- }
53
- });
54
- }
55
- cache.buildDependencies = {
56
- ...cache.buildDependencies,
57
- frameworkConfig: [
58
- configPath
59
- ]
60
- };
61
- chain.cache(cache);
62
- });
63
- }
64
- });
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
67
- pluginFrameworkConfig
68
- });