@rsbuild/plugin-babel 0.4.15 → 0.5.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/index.js CHANGED
@@ -162,14 +162,14 @@ var modifyBabelLoaderOptions = ({
162
162
  modifier
163
163
  }) => {
164
164
  const ruleIds = [CHAIN_ID.RULE.JS, CHAIN_ID.RULE.JS_DATA_URI, BABEL_JS_RULE];
165
- ruleIds.forEach((ruleId) => {
165
+ for (const ruleId of ruleIds) {
166
166
  if (chain.module.rules.has(ruleId)) {
167
167
  const rule = chain.module.rule(ruleId);
168
168
  if (rule.uses.has(CHAIN_ID.USE.BABEL)) {
169
169
  rule.use(CHAIN_ID.USE.BABEL).tap(modifier);
170
170
  }
171
171
  }
172
- });
172
+ }
173
173
  };
174
174
 
175
175
  // src/plugin.ts
@@ -254,14 +254,14 @@ var pluginBabel = (options = {}) => ({
254
254
  if (include || exclude) {
255
255
  const rule = chain.module.rule(BABEL_JS_RULE);
256
256
  if (include) {
257
- (0, import_shared2.castArray)(include).forEach((condition) => {
257
+ for (const condition of (0, import_shared2.castArray)(include)) {
258
258
  rule.include.add(condition);
259
- });
259
+ }
260
260
  }
261
261
  if (exclude) {
262
- (0, import_shared2.castArray)(exclude).forEach((condition) => {
262
+ for (const condition of (0, import_shared2.castArray)(exclude)) {
263
263
  rule.exclude.add(condition);
264
- });
264
+ }
265
265
  }
266
266
  const swcRule = chain.module.rules.get(CHAIN_ID.RULE.JS).use(CHAIN_ID.USE.SWC);
267
267
  const swcLoader = swcRule.get("loader");
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  throw Error('Dynamic require of "' + x + '" is not supported');
10
10
  });
11
11
 
12
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.48.0/node_modules/@modern-js/module-tools/shims/esm.js
12
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.48.2/node_modules/@modern-js/module-tools/shims/esm.js
13
13
  import { fileURLToPath } from "url";
14
14
  import path from "path";
15
15
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -150,14 +150,14 @@ var modifyBabelLoaderOptions = ({
150
150
  modifier
151
151
  }) => {
152
152
  const ruleIds = [CHAIN_ID.RULE.JS, CHAIN_ID.RULE.JS_DATA_URI, BABEL_JS_RULE];
153
- ruleIds.forEach((ruleId) => {
153
+ for (const ruleId of ruleIds) {
154
154
  if (chain.module.rules.has(ruleId)) {
155
155
  const rule = chain.module.rule(ruleId);
156
156
  if (rule.uses.has(CHAIN_ID.USE.BABEL)) {
157
157
  rule.use(CHAIN_ID.USE.BABEL).tap(modifier);
158
158
  }
159
159
  }
160
- });
160
+ }
161
161
  };
162
162
 
163
163
  // src/plugin.ts
@@ -242,14 +242,14 @@ var pluginBabel = (options = {}) => ({
242
242
  if (include || exclude) {
243
243
  const rule = chain.module.rule(BABEL_JS_RULE);
244
244
  if (include) {
245
- castArray2(include).forEach((condition) => {
245
+ for (const condition of castArray2(include)) {
246
246
  rule.include.add(condition);
247
- });
247
+ }
248
248
  }
249
249
  if (exclude) {
250
- castArray2(exclude).forEach((condition) => {
250
+ for (const condition of castArray2(exclude)) {
251
251
  rule.exclude.add(condition);
252
- });
252
+ }
253
253
  }
254
254
  const swcRule = chain.module.rules.get(CHAIN_ID.RULE.JS).use(CHAIN_ID.USE.SWC);
255
255
  const swcLoader = swcRule.get("loader");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-babel",
3
- "version": "0.4.15",
3
+ "version": "0.5.0",
4
4
  "description": "Babel plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,16 +28,16 @@
28
28
  "@babel/plugin-proposal-decorators": "^7.23.2",
29
29
  "@types/babel__core": "^7.20.3",
30
30
  "upath": "2.0.1",
31
- "@rsbuild/shared": "0.4.15"
31
+ "@rsbuild/shared": "0.5.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "16.x",
35
35
  "typescript": "^5.4.2",
36
- "@rsbuild/core": "0.4.15",
37
- "@scripts/test-helper": "0.4.15"
36
+ "@rsbuild/core": "0.5.0",
37
+ "@scripts/test-helper": "0.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@rsbuild/core": "^0.4.15"
40
+ "@rsbuild/core": "^0.5.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",