@modern-js/builder 2.1.0 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @modern-js/builder
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f9a26fe: fix(@modern-js/builder-shared): openBrowser add openChrome.applescript script
8
+
9
+ fix(@modern-js/builder-shared): openBrowser 添加 openChrome.applescript 脚本
10
+
11
+ ### Patch Changes
12
+
13
+ - 7cd8185: chore: reuse splitChunks plugin between rspack-provider and webpack-provider
14
+
15
+ chore: 在 rspack-provider 和 webpack-provider 间复用 splitChunks plugin
16
+
17
+ - Updated dependencies [fd5a3ed]
18
+ - Updated dependencies [67ba34a]
19
+ - Updated dependencies [2ad9fdf]
20
+ - Updated dependencies [f9a26fe]
21
+ - Updated dependencies [6ca1c0b]
22
+ - Updated dependencies [89b6739]
23
+ - @modern-js/utils@2.3.0
24
+ - @modern-js/builder-shared@2.3.0
25
+
26
+ ## 2.2.0
27
+
28
+ ### Patch Changes
29
+
30
+ - d82b621: feat(builder): support port placeholder in dev.startUrl config
31
+
32
+ feat(builder): 支持在 dev.startUrl 配置项中使用端口号占位符
33
+
34
+ - 16bdc0a: chore: adjust builder plugin name
35
+
36
+ chore: 调整 builder 插件命名格式
37
+
38
+ - Updated dependencies [f2f8a83]
39
+ - Updated dependencies [49eff0c]
40
+ - @modern-js/builder-shared@2.2.0
41
+ - @modern-js/utils@2.2.0
42
+
3
43
  ## 2.1.0
4
44
 
5
45
  ### Patch Changes
@@ -1,2 +1,2 @@
1
1
  import { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginCache: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginCache: () => DefaultBuilderPlugin;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.PluginCache = void 0;
26
+ exports.builderPluginCache = void 0;
27
27
  const path_1 = require("path");
28
28
  const builder_shared_1 = require("@modern-js/builder-shared");
29
29
  async function validateCache(cacheDirectory, buildDependencies) {
@@ -51,7 +51,7 @@ function getCacheDirectory({ cacheDirectory }, context) {
51
51
  }
52
52
  return (0, path_1.join)(context.cachePath, context.bundlerType);
53
53
  }
54
- const PluginCache = () => ({
54
+ const builderPluginCache = () => ({
55
55
  name: 'builder-plugin-cache',
56
56
  setup(api) {
57
57
  api.modifyBundlerChain(async (chain, { target, env }) => {
@@ -93,4 +93,4 @@ const PluginCache = () => ({
93
93
  });
94
94
  },
95
95
  });
96
- exports.PluginCache = PluginCache;
96
+ exports.builderPluginCache = builderPluginCache;
@@ -1,2 +1,2 @@
1
1
  import type { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginCleanOutput: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginCleanOutput: () => DefaultBuilderPlugin;
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.PluginCleanOutput = void 0;
27
- const PluginCleanOutput = () => ({
26
+ exports.builderPluginCleanOutput = void 0;
27
+ const builderPluginCleanOutput = () => ({
28
28
  name: 'builder-plugin-clean-output',
29
29
  setup(api) {
30
30
  const clean = async () => {
@@ -39,4 +39,4 @@ const PluginCleanOutput = () => ({
39
39
  api.onBeforeStartDevServer(clean);
40
40
  },
41
41
  });
42
- exports.PluginCleanOutput = PluginCleanOutput;
42
+ exports.builderPluginCleanOutput = builderPluginCleanOutput;
@@ -1,2 +1,2 @@
1
1
  import { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginDevtool: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginDevtool: () => DefaultBuilderPlugin;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PluginDevtool = void 0;
3
+ exports.builderPluginDevtool = void 0;
4
4
  const builder_shared_1 = require("@modern-js/builder-shared");
5
- const PluginDevtool = () => ({
5
+ const builderPluginDevtool = () => ({
6
6
  name: 'builder-plugin-devtool',
7
7
  setup(api) {
8
8
  api.modifyBundlerChain((chain, { isProd }) => {
@@ -20,4 +20,4 @@ const PluginDevtool = () => ({
20
20
  });
21
21
  },
22
22
  });
23
- exports.PluginDevtool = PluginDevtool;
23
+ exports.builderPluginDevtool = builderPluginDevtool;
@@ -1,2 +1,2 @@
1
1
  import { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginEntry: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginEntry: () => DefaultBuilderPlugin;
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PluginEntry = void 0;
6
+ exports.builderPluginEntry = void 0;
7
7
  const lodash_1 = __importDefault(require("@modern-js/utils/lodash"));
8
- const PluginEntry = () => ({
8
+ const builderPluginEntry = () => ({
9
9
  name: 'builder-plugin-entry',
10
10
  setup(api) {
11
11
  api.modifyBundlerChain(async (chain) => {
@@ -19,4 +19,4 @@ const PluginEntry = () => ({
19
19
  });
20
20
  },
21
21
  });
22
- exports.PluginEntry = PluginEntry;
22
+ exports.builderPluginEntry = builderPluginEntry;
@@ -1,4 +1,4 @@
1
1
  import type { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
2
  /** Filter source map files */
3
3
  export declare const filterAsset: (asset: string) => boolean;
4
- export declare const PluginFileSize: () => DefaultBuilderPlugin;
4
+ export declare const builderPluginFileSize: () => DefaultBuilderPlugin;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.PluginFileSize = exports.filterAsset = void 0;
29
+ exports.builderPluginFileSize = exports.filterAsset = void 0;
30
30
  /**
31
31
  * modified from https://github.com/facebook/create-react-app
32
32
  * license at https://github.com/facebook/create-react-app/blob/master/LICENSE
@@ -116,7 +116,7 @@ async function printFileSizes(stats, distPath) {
116
116
  });
117
117
  builder_shared_1.logger.log('');
118
118
  }
119
- const PluginFileSize = () => ({
119
+ const builderPluginFileSize = () => ({
120
120
  name: 'builder-plugin-file-size',
121
121
  setup(api) {
122
122
  api.onAfterBuild(async ({ stats }) => {
@@ -127,4 +127,4 @@ const PluginFileSize = () => ({
127
127
  });
128
128
  },
129
129
  });
130
- exports.PluginFileSize = PluginFileSize;
130
+ exports.builderPluginFileSize = builderPluginFileSize;
@@ -8,4 +8,5 @@ export declare const plugins: {
8
8
  cache: () => Promise<import("@modern-js/builder-shared").DefaultBuilderPlugin>;
9
9
  yaml: () => Promise<import("@modern-js/builder-shared").DefaultBuilderPlugin>;
10
10
  toml: () => Promise<import("@modern-js/builder-shared").DefaultBuilderPlugin>;
11
+ splitChunks: () => Promise<import("@modern-js/builder-shared").DefaultBuilderPlugin>;
11
12
  };
@@ -25,13 +25,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.plugins = void 0;
27
27
  exports.plugins = {
28
- cleanOutput: () => Promise.resolve().then(() => __importStar(require('./cleanOutput'))).then(m => m.PluginCleanOutput()),
29
- startUrl: () => Promise.resolve().then(() => __importStar(require('./startUrl'))).then(m => m.PluginStartUrl()),
30
- fileSize: () => Promise.resolve().then(() => __importStar(require('./fileSize'))).then(m => m.PluginFileSize()),
31
- devtool: () => Promise.resolve().then(() => __importStar(require('./devtool'))).then(m => m.PluginDevtool()),
32
- target: () => Promise.resolve().then(() => __importStar(require('./target'))).then(m => m.PluginTarget()),
33
- entry: () => Promise.resolve().then(() => __importStar(require('./entry'))).then(m => m.PluginEntry()),
34
- cache: () => Promise.resolve().then(() => __importStar(require('./cache'))).then(m => m.PluginCache()),
35
- yaml: () => Promise.resolve().then(() => __importStar(require('./yaml'))).then(m => m.PluginYaml()),
36
- toml: () => Promise.resolve().then(() => __importStar(require('./toml'))).then(m => m.PluginToml()),
28
+ cleanOutput: () => Promise.resolve().then(() => __importStar(require('./cleanOutput'))).then(m => m.builderPluginCleanOutput()),
29
+ startUrl: () => Promise.resolve().then(() => __importStar(require('./startUrl'))).then(m => m.builderPluginStartUrl()),
30
+ fileSize: () => Promise.resolve().then(() => __importStar(require('./fileSize'))).then(m => m.builderPluginFileSize()),
31
+ devtool: () => Promise.resolve().then(() => __importStar(require('./devtool'))).then(m => m.builderPluginDevtool()),
32
+ target: () => Promise.resolve().then(() => __importStar(require('./target'))).then(m => m.builderPluginTarget()),
33
+ entry: () => Promise.resolve().then(() => __importStar(require('./entry'))).then(m => m.builderPluginEntry()),
34
+ cache: () => Promise.resolve().then(() => __importStar(require('./cache'))).then(m => m.builderPluginCache()),
35
+ yaml: () => Promise.resolve().then(() => __importStar(require('./yaml'))).then(m => m.builderPluginYaml()),
36
+ toml: () => Promise.resolve().then(() => __importStar(require('./toml'))).then(m => m.builderPluginToml()),
37
+ splitChunks: () => Promise.resolve().then(() => __importStar(require('./splitChunks'))).then(m => m.builderPluginSplitChunks()),
37
38
  };
@@ -0,0 +1,2 @@
1
+ import { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
+ export declare function builderPluginSplitChunks(): DefaultBuilderPlugin;
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.builderPluginSplitChunks = void 0;
30
+ const assert_1 = __importDefault(require("assert"));
31
+ const builder_shared_1 = require("@modern-js/builder-shared");
32
+ function getUserDefinedCacheGroups(forceSplitting) {
33
+ const cacheGroups = {};
34
+ forceSplitting.forEach((reg, index) => {
35
+ const key = `force-split-${index}`;
36
+ cacheGroups[key] = {
37
+ test: reg,
38
+ name: key,
39
+ chunks: 'all',
40
+ // Ignore minimum size, minimum chunks and maximum requests and always create chunks for user defined cache group.
41
+ enforce: true,
42
+ };
43
+ });
44
+ return cacheGroups;
45
+ }
46
+ async function splitByExperience(ctx) {
47
+ const { isPackageInstalled } = await Promise.resolve().then(() => __importStar(require('@modern-js/utils')));
48
+ const { override, polyfill, rootPath, defaultConfig, userDefinedCacheGroups, } = ctx;
49
+ const experienceCacheGroup = {};
50
+ const packageRegExps = {
51
+ react: /[\\/]react|react-dom[\\/]/,
52
+ router: /[\\/]react-router|react-router-dom|history[\\/]/,
53
+ lodash: /[\\/]lodash|lodash-es[\\/]/,
54
+ };
55
+ // Detect if the package is installed in current project
56
+ // If installed, add the package to cache group
57
+ if (isPackageInstalled('antd', rootPath)) {
58
+ packageRegExps.antd = /[\\/]antd[\\/]/;
59
+ }
60
+ if (isPackageInstalled('@arco-design/web-react', rootPath)) {
61
+ packageRegExps.arco = /[\\/]arco-design[\\/]/;
62
+ }
63
+ if (isPackageInstalled('@douyinfe/semi-ui', rootPath)) {
64
+ packageRegExps.semi = /[\\/]semi-ui[\\/]/;
65
+ }
66
+ if (polyfill === 'entry' || polyfill === 'usage') {
67
+ packageRegExps.polyfill = /[\\/]core-js|@babel\/runtime[\\/]/;
68
+ }
69
+ Object.entries(packageRegExps).forEach(([name, test]) => {
70
+ const key = `lib-${name}`;
71
+ experienceCacheGroup[key] = {
72
+ test,
73
+ priority: 0,
74
+ name: key,
75
+ reuseExistingChunk: true,
76
+ };
77
+ });
78
+ (0, assert_1.default)(defaultConfig !== false);
79
+ (0, assert_1.default)(override !== false);
80
+ return {
81
+ ...defaultConfig,
82
+ ...override,
83
+ cacheGroups: {
84
+ ...defaultConfig.cacheGroups,
85
+ ...experienceCacheGroup,
86
+ ...userDefinedCacheGroups,
87
+ ...override.cacheGroups,
88
+ },
89
+ };
90
+ }
91
+ function splitByModule(ctx) {
92
+ const { override, userDefinedCacheGroups, defaultConfig } = ctx;
93
+ (0, assert_1.default)(defaultConfig !== false);
94
+ (0, assert_1.default)(override !== false);
95
+ return {
96
+ ...defaultConfig,
97
+ minSize: 0,
98
+ maxInitialRequests: Infinity,
99
+ ...override,
100
+ cacheGroups: {
101
+ ...defaultConfig.cacheGroups,
102
+ ...userDefinedCacheGroups,
103
+ // Core group
104
+ vendors: {
105
+ priority: -10,
106
+ test: /[\\/]node_modules[\\/]/,
107
+ // todo: not support in rspack
108
+ name(module) {
109
+ return (0, builder_shared_1.getPackageNameFromModulePath)(module.context);
110
+ },
111
+ },
112
+ ...override.cacheGroups,
113
+ },
114
+ };
115
+ }
116
+ function splitBySize(ctx) {
117
+ var _a, _b;
118
+ const { override, userDefinedCacheGroups, defaultConfig, builderConfig } = ctx;
119
+ (0, assert_1.default)(defaultConfig !== false);
120
+ (0, assert_1.default)(override !== false);
121
+ (0, assert_1.default)(builderConfig.strategy === 'split-by-size');
122
+ return {
123
+ ...defaultConfig,
124
+ minSize: (_a = builderConfig.minSize) !== null && _a !== void 0 ? _a : 0,
125
+ maxSize: (_b = builderConfig.maxSize) !== null && _b !== void 0 ? _b : Infinity,
126
+ ...override,
127
+ cacheGroups: {
128
+ ...defaultConfig.cacheGroups,
129
+ ...userDefinedCacheGroups,
130
+ ...override.cacheGroups,
131
+ },
132
+ };
133
+ }
134
+ function splitCustom(ctx) {
135
+ const { override, userDefinedCacheGroups, defaultConfig } = ctx;
136
+ (0, assert_1.default)(defaultConfig !== false);
137
+ (0, assert_1.default)(override !== false);
138
+ return {
139
+ ...defaultConfig,
140
+ ...override,
141
+ cacheGroups: {
142
+ ...defaultConfig.cacheGroups,
143
+ ...userDefinedCacheGroups,
144
+ ...override.cacheGroups,
145
+ },
146
+ };
147
+ }
148
+ function allInOne(_ctx) {
149
+ // Set false to avoid chunk split.
150
+ return false;
151
+ }
152
+ // Ignore user defined cache group to get single vendor chunk.
153
+ function singleVendor(ctx) {
154
+ const { override, defaultConfig } = ctx;
155
+ (0, assert_1.default)(defaultConfig !== false);
156
+ (0, assert_1.default)(override !== false);
157
+ return {
158
+ ...defaultConfig,
159
+ ...override,
160
+ cacheGroups: {
161
+ ...defaultConfig.cacheGroups,
162
+ ...override.cacheGroups,
163
+ },
164
+ };
165
+ }
166
+ const SPLIT_STRATEGY_DISPATCHER = {
167
+ 'split-by-experience': splitByExperience,
168
+ 'split-by-module': splitByModule,
169
+ 'split-by-size': splitBySize,
170
+ custom: splitCustom,
171
+ 'all-in-one': allInOne,
172
+ 'single-vendor': singleVendor,
173
+ };
174
+ function builderPluginSplitChunks() {
175
+ return {
176
+ name: 'builder-plugin-split-chunks',
177
+ setup(api) {
178
+ api.modifyBundlerChain(async (chain, { isServer, isWebWorker }) => {
179
+ var _a;
180
+ if (isServer || isWebWorker) {
181
+ chain.optimization.splitChunks(false);
182
+ // web worker does not support dynamic imports, dynamicImportMode need set to eager
183
+ if (isWebWorker) {
184
+ // todo: not support in rspack
185
+ // @ts-expect-error
186
+ chain.module.parser.merge({
187
+ javascript: {
188
+ dynamicImportMode: 'eager',
189
+ },
190
+ });
191
+ }
192
+ return;
193
+ }
194
+ const config = api.getNormalizedConfig();
195
+ const defaultConfig = {
196
+ // Optimize both `initial` and `async` chunks
197
+ chunks: 'all',
198
+ // When chunk size >= 50000 bytes, split it into separate chunk
199
+ enforceSizeThreshold: 50000,
200
+ cacheGroups: {},
201
+ };
202
+ const { chunkSplit } = config.performance;
203
+ let userDefinedCacheGroups = {};
204
+ if (chunkSplit.forceSplitting) {
205
+ userDefinedCacheGroups = getUserDefinedCacheGroups(chunkSplit.forceSplitting);
206
+ }
207
+ // Patch the override config difference between the `custom` strategy and other strategy.
208
+ const override = chunkSplit.strategy === 'custom'
209
+ ? // `chunkSplit.splitChunks` compat for Eden
210
+ (_a = chunkSplit.splitChunks) !== null && _a !== void 0 ? _a : chunkSplit.override
211
+ : chunkSplit.override;
212
+ // Apply different strategy
213
+ const splitChunksOptions = await SPLIT_STRATEGY_DISPATCHER[chunkSplit.strategy]({
214
+ defaultConfig,
215
+ override: override || {},
216
+ userDefinedCacheGroups,
217
+ builderConfig: chunkSplit,
218
+ rootPath: api.context.rootPath,
219
+ polyfill: config.output.polyfill,
220
+ });
221
+ chain.optimization.splitChunks(splitChunksOptions);
222
+ // should not extract runtime chunk when strategy is `all-in-one`
223
+ if (chunkSplit.strategy !== 'all-in-one') {
224
+ chain.optimization.runtimeChunk({
225
+ name: builder_shared_1.RUNTIME_CHUNK_NAME,
226
+ });
227
+ }
228
+ });
229
+ },
230
+ };
231
+ }
232
+ exports.builderPluginSplitChunks = builderPluginSplitChunks;
@@ -1,2 +1,3 @@
1
1
  import type { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare function PluginStartUrl(): DefaultBuilderPlugin;
2
+ export declare const replacePlaceholder: (url: string, port: number) => string;
3
+ export declare function builderPluginStartUrl(): DefaultBuilderPlugin;
@@ -26,9 +26,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.PluginStartUrl = void 0;
29
+ exports.builderPluginStartUrl = exports.replacePlaceholder = void 0;
30
30
  const lodash_1 = __importDefault(require("@modern-js/utils/lodash"));
31
- function PluginStartUrl() {
31
+ const replacePlaceholder = (url, port) => url.replace(/<port>/g, String(port));
32
+ exports.replacePlaceholder = replacePlaceholder;
33
+ function builderPluginStartUrl() {
32
34
  return {
33
35
  name: 'builder-plugin-start-url',
34
36
  async setup(api) {
@@ -41,24 +43,24 @@ function PluginStartUrl() {
41
43
  return;
42
44
  }
43
45
  const config = api.getNormalizedConfig();
44
- const { startUrl } = config.dev;
46
+ const { https, startUrl } = config.dev;
45
47
  if (!startUrl) {
46
48
  return;
47
49
  }
48
- const { default: open } = await Promise.resolve().then(() => __importStar(require('@modern-js/builder-shared/open')));
49
50
  const urls = [];
50
51
  if (startUrl === true) {
51
- const protocol = config.dev.https ? 'https' : 'http';
52
+ const protocol = https ? 'https' : 'http';
52
53
  urls.push(`${protocol}://localhost:${port}`);
53
54
  }
54
55
  else {
55
- urls.push(...lodash_1.default.castArray(startUrl));
56
+ urls.push(...lodash_1.default.castArray(startUrl).map(item => (0, exports.replacePlaceholder)(item, port)));
56
57
  }
58
+ const { openBrowser } = await Promise.resolve().then(() => __importStar(require('@modern-js/builder-shared')));
57
59
  for (const url of urls) {
58
- await open(url);
60
+ await openBrowser(url);
59
61
  }
60
62
  });
61
63
  },
62
64
  };
63
65
  }
64
- exports.PluginStartUrl = PluginStartUrl;
66
+ exports.builderPluginStartUrl = builderPluginStartUrl;
@@ -1,2 +1,2 @@
1
1
  import type { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginTarget: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginTarget: () => DefaultBuilderPlugin;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PluginTarget = void 0;
3
+ exports.builderPluginTarget = void 0;
4
4
  const builder_shared_1 = require("@modern-js/builder-shared");
5
- const PluginTarget = () => ({
5
+ const builderPluginTarget = () => ({
6
6
  name: 'builder-plugin-target',
7
7
  setup(api) {
8
8
  api.modifyBundlerChain(async (chain, { target }) => {
@@ -24,4 +24,4 @@ const PluginTarget = () => ({
24
24
  });
25
25
  },
26
26
  });
27
- exports.PluginTarget = PluginTarget;
27
+ exports.builderPluginTarget = builderPluginTarget;
@@ -1,2 +1,2 @@
1
1
  import type { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginToml: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginToml: () => DefaultBuilderPlugin;
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PluginToml = void 0;
6
+ exports.builderPluginToml = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const PluginToml = () => ({
8
+ const builderPluginToml = () => ({
9
9
  name: 'builder-plugin-toml',
10
10
  setup(api) {
11
11
  api.modifyBundlerChain((chain, { CHAIN_ID }) => {
@@ -18,4 +18,4 @@ const PluginToml = () => ({
18
18
  });
19
19
  },
20
20
  });
21
- exports.PluginToml = PluginToml;
21
+ exports.builderPluginToml = builderPluginToml;
@@ -1,2 +1,2 @@
1
1
  import type { DefaultBuilderPlugin } from '@modern-js/builder-shared';
2
- export declare const PluginYaml: () => DefaultBuilderPlugin;
2
+ export declare const builderPluginYaml: () => DefaultBuilderPlugin;
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PluginYaml = void 0;
6
+ exports.builderPluginYaml = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const PluginYaml = () => ({
8
+ const builderPluginYaml = () => ({
9
9
  name: 'builder-plugin-yaml',
10
10
  setup(api) {
11
11
  api.modifyBundlerChain((chain, { CHAIN_ID }) => {
@@ -18,4 +18,4 @@ const PluginYaml = () => ({
18
18
  });
19
19
  },
20
20
  });
21
- exports.PluginYaml = PluginYaml;
21
+ exports.builderPluginYaml = builderPluginYaml;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "engines": {
15
15
  "node": ">=14.0.0"
16
16
  },
17
- "version": "2.1.0",
17
+ "version": "2.3.0",
18
18
  "jsnext:source": "./src/index.ts",
19
19
  "types": "./dist/index.d.ts",
20
20
  "main": "./dist/index.js",
@@ -27,8 +27,8 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@modern-js/builder-shared": "2.1.0",
31
- "@modern-js/utils": "2.1.0"
30
+ "@modern-js/builder-shared": "2.3.0",
31
+ "@modern-js/utils": "2.3.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/core": "7.18.0",
@@ -36,7 +36,7 @@
36
36
  "@types/babel__preset-env": "^7.9.2",
37
37
  "@types/node": "^14",
38
38
  "typescript": "^4",
39
- "@scripts/vitest-config": "2.1.0"
39
+ "@scripts/vitest-config": "2.3.0"
40
40
  },
41
41
  "publishConfig": {
42
42
  "registry": "https://registry.npmjs.org/",