@rsbuild/plugin-babel 1.0.5 → 1.0.7

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/README.md CHANGED
@@ -7,12 +7,12 @@ An Rsbuild plugin to use Babel to transpile the code.
7
7
  <img src="https://img.shields.io/npm/v/@rsbuild/plugin-babel?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
8
8
  </a>
9
9
  <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
10
- <a href="https://npmcharts.com/compare/@rsbuild/plugin-babel?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-babel.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
10
+ <a href="https://npmcharts.com/compare/@rsbuild/plugin-babel"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-babel.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11
11
  </p>
12
12
 
13
13
  ## Documentation
14
14
 
15
- See [Documentation](https://rsbuild.dev/plugins/list/plugin-babel).
15
+ See [Documentation](https://rsbuild.rs/plugins/list/plugin-babel).
16
16
 
17
17
  ## License
18
18
 
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 272: (module) => {
3
+ 808: (module) => {
4
4
  const STRIP_FILENAME_RE = /^[^:]+: /;
5
5
  const format = (err) => {
6
6
  if (err instanceof SyntaxError) {
@@ -26,16 +26,16 @@
26
26
  }
27
27
  module.exports = LoaderError;
28
28
  },
29
- 124: (module, __unused_webpack_exports, __nccwpck_require__) => {
29
+ 908: (module, __unused_webpack_exports, __nccwpck_require__) => {
30
30
  const os = __nccwpck_require__(857);
31
31
  const path = __nccwpck_require__(928);
32
32
  const zlib = __nccwpck_require__(106);
33
33
  const { promisify } = __nccwpck_require__(23);
34
34
  const { readFile, writeFile, mkdir } = __nccwpck_require__(943);
35
- const { sync: findUpSync } = __nccwpck_require__(609);
35
+ const { sync: findUpSync } = __nccwpck_require__(48);
36
36
  const { env } = process;
37
- const transform = __nccwpck_require__(790);
38
- const serialize = __nccwpck_require__(436);
37
+ const transform = __nccwpck_require__(30);
38
+ const serialize = __nccwpck_require__(452);
39
39
  let defaultCacheDirectory = null;
40
40
  const gunzip = promisify(zlib.gunzip);
41
41
  const gzip = promisify(zlib.gzip);
@@ -165,7 +165,7 @@
165
165
  return os.tmpdir();
166
166
  }
167
167
  },
168
- 674: (module, __unused_webpack_exports, __nccwpck_require__) => {
168
+ 314: (module, __unused_webpack_exports, __nccwpck_require__) => {
169
169
  let babel;
170
170
  try {
171
171
  babel = __nccwpck_require__(571);
@@ -184,10 +184,10 @@
184
184
  );
185
185
  }
186
186
  const { version } = __nccwpck_require__(344);
187
- const cache = __nccwpck_require__(124);
188
- const transform = __nccwpck_require__(790);
189
- const injectCaller = __nccwpck_require__(846);
190
- const schema = __nccwpck_require__(348);
187
+ const cache = __nccwpck_require__(908);
188
+ const transform = __nccwpck_require__(30);
189
+ const injectCaller = __nccwpck_require__(174);
190
+ const schema = __nccwpck_require__(779);
191
191
  const { isAbsolute } = __nccwpck_require__(928);
192
192
  const { promisify } = __nccwpck_require__(23);
193
193
  function subscribe(subscriber, metadata, context) {
@@ -373,7 +373,7 @@
373
373
  return [source, inputSourceMap];
374
374
  }
375
375
  },
376
- 846: (module) => {
376
+ 174: (module) => {
377
377
  module.exports = function injectCaller(opts, target) {
378
378
  return Object.assign({}, opts, {
379
379
  caller: Object.assign(
@@ -389,7 +389,7 @@
389
389
  });
390
390
  };
391
391
  },
392
- 436: (module) => {
392
+ 452: (module) => {
393
393
  var objToString = Object.prototype.toString;
394
394
  var objKeys = Object.getOwnPropertyNames;
395
395
  function serialize(val, isArrayProp) {
@@ -455,10 +455,10 @@
455
455
  }
456
456
  };
457
457
  },
458
- 790: (module, __unused_webpack_exports, __nccwpck_require__) => {
458
+ 30: (module, __unused_webpack_exports, __nccwpck_require__) => {
459
459
  const babel = __nccwpck_require__(571);
460
460
  const { promisify } = __nccwpck_require__(23);
461
- const LoaderError = __nccwpck_require__(272);
461
+ const LoaderError = __nccwpck_require__(808);
462
462
  const transform = promisify(babel.transform);
463
463
  module.exports = async function (source, options) {
464
464
  let result;
@@ -487,11 +487,11 @@
487
487
  };
488
488
  module.exports.version = babel.version;
489
489
  },
490
- 609: (module, __unused_webpack_exports, __nccwpck_require__) => {
490
+ 48: (module, __unused_webpack_exports, __nccwpck_require__) => {
491
491
  "use strict";
492
492
  const path = __nccwpck_require__(928);
493
- const locatePath = __nccwpck_require__(440);
494
- const pathExists = __nccwpck_require__(374);
493
+ const locatePath = __nccwpck_require__(597);
494
+ const pathExists = __nccwpck_require__(219);
495
495
  const stop = Symbol("findUp.stop");
496
496
  module.exports = async (name, options = {}) => {
497
497
  let directory = path.resolve(options.cwd || "");
@@ -553,12 +553,12 @@
553
553
  module.exports.sync.exists = pathExists.sync;
554
554
  module.exports.stop = stop;
555
555
  },
556
- 440: (module, __unused_webpack_exports, __nccwpck_require__) => {
556
+ 597: (module, __unused_webpack_exports, __nccwpck_require__) => {
557
557
  "use strict";
558
558
  const path = __nccwpck_require__(928);
559
559
  const fs = __nccwpck_require__(896);
560
560
  const { promisify } = __nccwpck_require__(23);
561
- const pLocate = __nccwpck_require__(601);
561
+ const pLocate = __nccwpck_require__(108);
562
562
  const fsStat = promisify(fs.stat);
563
563
  const fsLStat = promisify(fs.lstat);
564
564
  const typeMappings = { directory: "isDirectory", file: "isFile" };
@@ -611,9 +611,9 @@
611
611
  }
612
612
  };
613
613
  },
614
- 600: (module, __unused_webpack_exports, __nccwpck_require__) => {
614
+ 333: (module, __unused_webpack_exports, __nccwpck_require__) => {
615
615
  "use strict";
616
- const Queue = __nccwpck_require__(179);
616
+ const Queue = __nccwpck_require__(882);
617
617
  const pLimit = (concurrency) => {
618
618
  if (
619
619
  !(
@@ -668,9 +668,9 @@
668
668
  };
669
669
  module.exports = pLimit;
670
670
  },
671
- 601: (module, __unused_webpack_exports, __nccwpck_require__) => {
671
+ 108: (module, __unused_webpack_exports, __nccwpck_require__) => {
672
672
  "use strict";
673
- const pLimit = __nccwpck_require__(600);
673
+ const pLimit = __nccwpck_require__(333);
674
674
  class EndError extends Error {
675
675
  constructor(value) {
676
676
  super();
@@ -706,7 +706,7 @@
706
706
  };
707
707
  module.exports = pLocate;
708
708
  },
709
- 374: (module, __unused_webpack_exports, __nccwpck_require__) => {
709
+ 219: (module, __unused_webpack_exports, __nccwpck_require__) => {
710
710
  "use strict";
711
711
  const fs = __nccwpck_require__(896);
712
712
  const { promisify } = __nccwpck_require__(23);
@@ -728,7 +728,7 @@
728
728
  }
729
729
  };
730
730
  },
731
- 179: (module) => {
731
+ 882: (module) => {
732
732
  class Node {
733
733
  constructor(value) {
734
734
  this.value = value;
@@ -809,7 +809,7 @@
809
809
  "use strict";
810
810
  module.exports = require("zlib");
811
811
  },
812
- 348: (module) => {
812
+ 779: (module) => {
813
813
  "use strict";
814
814
  module.exports = JSON.parse(
815
815
  '{"title":"Babel Loader options","type":"object","properties":{"cacheDirectory":{"anyOf":[{"type":"boolean"},{"type":"string"}],"default":false},"cacheIdentifier":{"type":"string"},"cacheCompression":{"type":"boolean","default":true},"customize":{"anyOf":[{"type":"null"},{"type":"string"}],"default":null},"metadataSubscribers":{"type":"array"}},"additionalProperties":true}',
@@ -838,6 +838,6 @@
838
838
  }
839
839
  if (typeof __nccwpck_require__ !== "undefined")
840
840
  __nccwpck_require__.ab = __dirname + "/";
841
- var __webpack_exports__ = __nccwpck_require__(674);
841
+ var __webpack_exports__ = __nccwpck_require__(314);
842
842
  module.exports = __webpack_exports__;
843
843
  })();
package/dist/index.cjs CHANGED
@@ -1,18 +1,6 @@
1
1
  "use strict";
2
- let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
- var __webpack_modules__ = {
4
- "@babel/core": function(module) {
5
- module.exports = import("@babel/core");
6
- }
7
- }, __webpack_module_cache__ = {};
8
- function __webpack_require__(moduleId) {
9
- var cachedModule = __webpack_module_cache__[moduleId];
10
- if (void 0 !== cachedModule) return cachedModule.exports;
11
- var module = __webpack_module_cache__[moduleId] = {
12
- exports: {}
13
- };
14
- return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
15
- }
2
+ const __rslib_import_meta_url__ = "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ var __webpack_require__ = {};
16
4
  __webpack_require__.n = (module)=>{
17
5
  var getter = module && module.__esModule ? ()=>module.default : ()=>module;
18
6
  return __webpack_require__.d(getter, {
@@ -24,160 +12,172 @@ __webpack_require__.n = (module)=>{
24
12
  get: definition[key]
25
13
  });
26
14
  }, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
27
- 'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
15
+ "u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
28
16
  value: 'Module'
29
17
  }), Object.defineProperty(exports1, '__esModule', {
30
18
  value: !0
31
19
  });
32
20
  };
33
21
  var __webpack_exports__ = {};
34
- for(var __webpack_i__ in (()=>{
35
- __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
36
- getBabelUtils: ()=>getBabelUtils,
37
- getDefaultBabelOptions: ()=>getDefaultBabelOptions,
38
- pluginBabel: ()=>pluginBabel,
39
- modifyBabelLoaderOptions: ()=>modifyBabelLoaderOptions,
40
- PLUGIN_BABEL_NAME: ()=>PLUGIN_BABEL_NAME
22
+ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
23
+ getDefaultBabelOptions: ()=>getDefaultBabelOptions,
24
+ getBabelUtils: ()=>getBabelUtils,
25
+ modifyBabelLoaderOptions: ()=>modifyBabelLoaderOptions,
26
+ PLUGIN_BABEL_NAME: ()=>PLUGIN_BABEL_NAME,
27
+ pluginBabel: ()=>pluginBabel
28
+ });
29
+ const external_node_path_namespaceObject = require("node:path");
30
+ var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
31
+ const external_reduce_configs_namespaceObject = require("reduce-configs"), external_upath_namespaceObject = require("upath");
32
+ var external_upath_default = __webpack_require__.n(external_upath_namespaceObject);
33
+ const BABEL_JS_RULE = 'babel-js', castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
34
+ arr
35
+ ], normalizeToPosixPath = (p)=>external_upath_default().normalizeSafe((0, external_node_path_namespaceObject.normalize)(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`), formatPath = (originPath)=>(0, external_node_path_namespaceObject.isAbsolute)(originPath) ? originPath.split(external_node_path_namespaceObject.sep).join('/') : originPath, getPluginItemName = (item)=>'string' == typeof item ? formatPath(item) : Array.isArray(item) && 'string' == typeof item[0] ? formatPath(item[0]) : null, addPlugins = (plugins, config)=>{
36
+ config.plugins ? config.plugins.push(...plugins) : config.plugins = plugins;
37
+ }, addPresets = (presets, config)=>{
38
+ config.presets ? config.presets.push(...presets) : config.presets = presets;
39
+ }, removePlugins = (plugins, config)=>{
40
+ if (!config.plugins) return;
41
+ let removeList = castArray(plugins);
42
+ config.plugins = config.plugins.filter((item)=>{
43
+ let name = getPluginItemName(item);
44
+ return !name || !removeList.find((removeItem)=>name.includes(removeItem));
41
45
  });
42
- let external_node_fs_namespaceObject = require("node:fs");
43
- var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
44
- let external_node_module_namespaceObject = require("node:module"), external_node_path_namespaceObject = require("node:path");
45
- var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
46
- let external_node_url_namespaceObject = require("node:url"), external_deepmerge_namespaceObject = require("deepmerge");
47
- var external_deepmerge_default = __webpack_require__.n(external_deepmerge_namespaceObject);
48
- let external_reduce_configs_namespaceObject = require("reduce-configs"), external_upath_namespaceObject = require("upath");
49
- var external_upath_default = __webpack_require__.n(external_upath_namespaceObject);
50
- let BABEL_JS_RULE = 'babel-js', castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
51
- arr
52
- ], normalizeToPosixPath = (p)=>external_upath_default().normalizeSafe((0, external_node_path_namespaceObject.normalize)(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`), formatPath = (originPath)=>(0, external_node_path_namespaceObject.isAbsolute)(originPath) ? originPath.split(external_node_path_namespaceObject.sep).join('/') : originPath, getPluginItemName = (item)=>'string' == typeof item ? formatPath(item) : Array.isArray(item) && 'string' == typeof item[0] ? formatPath(item[0]) : null, addPlugins = (plugins, config)=>{
53
- config.plugins ? config.plugins.push(...plugins) : config.plugins = plugins;
54
- }, addPresets = (presets, config)=>{
55
- config.presets ? config.presets.push(...presets) : config.presets = presets;
56
- }, removePlugins = (plugins, config)=>{
57
- if (!config.plugins) return;
58
- let removeList = castArray(plugins);
59
- config.plugins = config.plugins.filter((item)=>{
60
- let name = getPluginItemName(item);
61
- return !name || !removeList.find((removeItem)=>name.includes(removeItem));
62
- });
63
- }, removePresets = (presets, config)=>{
64
- if (!config.presets) return;
65
- let removeList = castArray(presets);
66
- config.presets = config.presets.filter((item)=>{
67
- let name = getPluginItemName(item);
68
- return !name || !removeList.find((removeItem)=>name.includes(removeItem));
69
- });
70
- }, modifyPresetOptions = (presetName, options, presets = [])=>{
71
- presets.forEach((preset, index)=>{
72
- Array.isArray(preset) ? 'string' == typeof preset[0] && normalizeToPosixPath(preset[0]).includes(presetName) && (preset[1] = {
73
- ...preset[1] || {},
74
- ...options
75
- }) : 'string' == typeof preset && normalizeToPosixPath(preset).includes(presetName) && (presets[index] = [
76
- preset,
77
- options
78
- ]);
79
- });
80
- }, getBabelUtils = (config)=>{
81
- let noop = ()=>{};
82
- return {
83
- addPlugins: (plugins)=>addPlugins(plugins, config),
84
- addPresets: (presets)=>addPresets(presets, config),
85
- removePlugins: (plugins)=>removePlugins(plugins, config),
86
- removePresets: (presets)=>removePresets(presets, config),
87
- addIncludes: noop,
88
- addExcludes: noop,
89
- modifyPresetEnvOptions: (options)=>modifyPresetOptions('@babel/preset-env', options, config.presets || []),
90
- modifyPresetReactOptions: (options)=>modifyPresetOptions('@babel/preset-react', options, config.presets || [])
91
- };
92
- }, applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils)=>{
93
- if (userBabelConfig) {
94
- let babelUtils = {
95
- ...getBabelUtils(defaultOptions),
96
- ...extraBabelUtils
97
- };
98
- return (0, external_reduce_configs_namespaceObject.reduceConfigsWithContext)({
99
- initial: defaultOptions,
100
- config: userBabelConfig,
101
- ctx: babelUtils
102
- });
103
- }
104
- return defaultOptions;
105
- }, modifyBabelLoaderOptions = ({ chain, CHAIN_ID, modifier })=>{
106
- for (let ruleId of [
107
- CHAIN_ID.RULE.JS,
108
- CHAIN_ID.RULE.JS_DATA_URI,
109
- BABEL_JS_RULE
110
- ])if (chain.module.rules.has(ruleId)) {
111
- let rule = chain.module.rule(ruleId);
112
- rule.uses.has(CHAIN_ID.USE.BABEL) && rule.use(CHAIN_ID.USE.BABEL).tap(modifier);
46
+ }, removePresets = (presets, config)=>{
47
+ if (!config.presets) return;
48
+ let removeList = castArray(presets);
49
+ config.presets = config.presets.filter((item)=>{
50
+ let name = getPluginItemName(item);
51
+ return !name || !removeList.find((removeItem)=>name.includes(removeItem));
52
+ });
53
+ }, modifyPresetOptions = (presetName, options, presets = [])=>{
54
+ presets.forEach((preset, index)=>{
55
+ Array.isArray(preset) ? 'string' == typeof preset[0] && normalizeToPosixPath(preset[0]).includes(presetName) && (preset[1] = {
56
+ ...preset[1] || {},
57
+ ...options
58
+ }) : 'string' == typeof preset && normalizeToPosixPath(preset).includes(presetName) && (presets[index] = [
59
+ preset,
60
+ options
61
+ ]);
62
+ });
63
+ }, getBabelUtils = (config)=>{
64
+ let noop = ()=>{};
65
+ return {
66
+ addPlugins: (plugins)=>{
67
+ addPlugins(plugins, config);
68
+ },
69
+ addPresets: (presets)=>{
70
+ addPresets(presets, config);
71
+ },
72
+ removePlugins: (plugins)=>{
73
+ removePlugins(plugins, config);
74
+ },
75
+ removePresets: (presets)=>{
76
+ removePresets(presets, config);
77
+ },
78
+ addIncludes: noop,
79
+ addExcludes: noop,
80
+ modifyPresetEnvOptions: (options)=>{
81
+ modifyPresetOptions('@babel/preset-env', options, config.presets || []);
82
+ },
83
+ modifyPresetReactOptions: (options)=>{
84
+ modifyPresetOptions('@babel/preset-react', options, config.presets || []);
113
85
  }
114
- }, plugin_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__)), plugin_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), PLUGIN_BABEL_NAME = 'rsbuild:babel', SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
115
- allowNamespaces: !0,
116
- allExtensions: !0,
117
- allowDeclareFields: !0,
118
- optimizeConstEnums: !0,
119
- isTSX: !0
120
86
  };
121
- async function getCacheIdentifier(options) {
122
- let identifier = `${process.env.NODE_ENV}${JSON.stringify(options)}`, { version: coreVersion } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@babel/core")), loaderVersion = JSON.parse(await external_node_fs_default().promises.readFile((0, external_node_path_namespaceObject.join)(plugin_dirname, '../compiled/babel-loader/package.json'), 'utf-8')).version ?? '';
123
- return identifier += `@babel/core@${coreVersion}babel-loader@${loaderVersion}`;
87
+ }, applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils)=>{
88
+ if (userBabelConfig) {
89
+ let babelUtils = {
90
+ ...getBabelUtils(defaultOptions),
91
+ ...extraBabelUtils
92
+ };
93
+ return (0, external_reduce_configs_namespaceObject.reduceConfigsWithContext)({
94
+ initial: defaultOptions,
95
+ config: userBabelConfig,
96
+ ctx: babelUtils
97
+ });
124
98
  }
125
- let getDefaultBabelOptions = (config, context)=>{
126
- let isLegacyDecorators = 'legacy' === config.source.decorators.version, options = {
127
- babelrc: !1,
128
- configFile: !1,
129
- compact: 'production' === config.mode,
130
- plugins: [
131
- [
132
- plugin_require.resolve('@babel/plugin-proposal-decorators'),
133
- config.source.decorators
134
- ],
135
- ...isLegacyDecorators ? [
136
- plugin_require.resolve('@babel/plugin-transform-class-properties')
137
- ] : []
99
+ return defaultOptions;
100
+ }, modifyBabelLoaderOptions = ({ chain, CHAIN_ID, modifier })=>{
101
+ for (let ruleId of [
102
+ CHAIN_ID.RULE.JS,
103
+ CHAIN_ID.RULE.JS_DATA_URI,
104
+ BABEL_JS_RULE
105
+ ])if (chain.module.rules.has(ruleId)) {
106
+ let rule = chain.module.rule(ruleId);
107
+ rule.uses.has(CHAIN_ID.USE.BABEL) && rule.use(CHAIN_ID.USE.BABEL).tap(modifier);
108
+ }
109
+ }, external_node_fs_namespaceObject = require("node:fs");
110
+ var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
111
+ const external_node_module_namespaceObject = require("node:module"), external_node_url_namespaceObject = require("node:url"), external_deepmerge_namespaceObject = require("deepmerge");
112
+ var external_deepmerge_default = __webpack_require__.n(external_deepmerge_namespaceObject);
113
+ const plugin_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__)), plugin_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), PLUGIN_BABEL_NAME = 'rsbuild:babel', SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
114
+ allowNamespaces: !0,
115
+ allExtensions: !0,
116
+ allowDeclareFields: !0,
117
+ optimizeConstEnums: !0,
118
+ isTSX: !0
119
+ };
120
+ function getCacheDirectory(context, cacheDirectory) {
121
+ return cacheDirectory ? (0, external_node_path_namespaceObject.isAbsolute)(cacheDirectory) ? cacheDirectory : (0, external_node_path_namespaceObject.join)(context.rootPath, cacheDirectory) : (0, external_node_path_namespaceObject.join)(context.cachePath);
122
+ }
123
+ async function getCacheIdentifier(options) {
124
+ let identifier = `${process.env.NODE_ENV}${JSON.stringify(options)}`, { version: coreVersion } = await import("@babel/core"), loaderVersion = JSON.parse(await external_node_fs_default().promises.readFile((0, external_node_path_namespaceObject.join)(plugin_dirname, '../compiled/babel-loader/package.json'), 'utf-8')).version ?? '';
125
+ return identifier + `@babel/core@${coreVersion}babel-loader@${loaderVersion}`;
126
+ }
127
+ const getDefaultBabelOptions = (config, context)=>{
128
+ let isLegacyDecorators = 'legacy' === config.source.decorators.version, options = {
129
+ babelrc: !1,
130
+ configFile: !1,
131
+ compact: 'production' === config.mode,
132
+ plugins: [
133
+ [
134
+ plugin_require.resolve('@babel/plugin-proposal-decorators'),
135
+ config.source.decorators
138
136
  ],
139
- presets: [
140
- [
141
- plugin_require.resolve("@babel/preset-typescript"),
142
- DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS
143
- ]
137
+ ...isLegacyDecorators ? [
138
+ plugin_require.resolve('@babel/plugin-transform-class-properties')
139
+ ] : []
140
+ ],
141
+ presets: [
142
+ [
143
+ plugin_require.resolve("@babel/preset-typescript"),
144
+ DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS
144
145
  ]
145
- }, { buildCache = !0 } = config.performance;
146
- if (buildCache && 'rspack' === context.bundlerType) {
147
- let cacheDirectory = function(context, cacheDirectory) {
148
- return cacheDirectory ? (0, external_node_path_namespaceObject.isAbsolute)(cacheDirectory) ? cacheDirectory : (0, external_node_path_namespaceObject.join)(context.rootPath, cacheDirectory) : (0, external_node_path_namespaceObject.join)(context.cachePath);
149
- }(context, 'boolean' == typeof buildCache ? void 0 : buildCache.cacheDirectory);
150
- options.cacheCompression = !1, options.cacheDirectory = (0, external_node_path_namespaceObject.join)(cacheDirectory, 'babel-loader');
146
+ ]
147
+ }, { buildCache = !0 } = config.performance;
148
+ if (buildCache && 'rspack' === context.bundlerType) {
149
+ let cacheDirectory = getCacheDirectory(context, 'boolean' == typeof buildCache ? void 0 : buildCache.cacheDirectory);
150
+ options.cacheCompression = !1, options.cacheDirectory = (0, external_node_path_namespaceObject.join)(cacheDirectory, 'babel-loader');
151
+ }
152
+ return options;
153
+ }, pluginBabel = (options = {})=>({
154
+ name: PLUGIN_BABEL_NAME,
155
+ setup (api) {
156
+ let getBabelOptions = async (environment)=>{
157
+ let { config } = environment, baseOptions = getDefaultBabelOptions(config, api.context), mergedOptions = applyUserBabelConfig(external_deepmerge_default()({}, baseOptions), options.babelLoaderOptions);
158
+ return mergedOptions.cacheDirectory && !mergedOptions.cacheIdentifier && (mergedOptions.cacheIdentifier = await getCacheIdentifier(mergedOptions)), mergedOptions;
159
+ };
160
+ api.modifyBundlerChain({
161
+ order: 'pre',
162
+ handler: async (chain, { CHAIN_ID, environment })=>{
163
+ let babelOptions = await getBabelOptions(environment), babelLoader = external_node_path_default().resolve(plugin_dirname, '../compiled/babel-loader/index.js'), { include, exclude } = options;
164
+ if (include || exclude) {
165
+ let rule = chain.module.rule(BABEL_JS_RULE).after(CHAIN_ID.RULE.JS);
166
+ if (include) for (let condition of castArray(include))rule.include.add(condition);
167
+ if (exclude) for (let condition of castArray(exclude))rule.exclude.add(condition);
168
+ rule.test(SCRIPT_REGEX).use(CHAIN_ID.USE.BABEL).loader(babelLoader).options(babelOptions);
169
+ } else chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).use(CHAIN_ID.USE.BABEL).after(CHAIN_ID.USE.SWC).loader(babelLoader).options(babelOptions);
170
+ }
171
+ });
151
172
  }
152
- return options;
153
- }, pluginBabel = (options = {})=>({
154
- name: PLUGIN_BABEL_NAME,
155
- setup (api) {
156
- let getBabelOptions = async (environment)=>{
157
- let { config } = environment, baseOptions = getDefaultBabelOptions(config, api.context), mergedOptions = applyUserBabelConfig(external_deepmerge_default()({}, baseOptions), options.babelLoaderOptions);
158
- return mergedOptions.cacheDirectory && !mergedOptions.cacheIdentifier && (mergedOptions.cacheIdentifier = await getCacheIdentifier(mergedOptions)), mergedOptions;
159
- };
160
- api.modifyBundlerChain({
161
- order: 'pre',
162
- handler: async (chain, { CHAIN_ID, environment })=>{
163
- let babelOptions = await getBabelOptions(environment), babelLoader = external_node_path_default().resolve(plugin_dirname, '../compiled/babel-loader/index.js'), { include, exclude } = options;
164
- if (include || exclude) {
165
- let rule = chain.module.rule(BABEL_JS_RULE).after(CHAIN_ID.RULE.JS);
166
- if (include) for (let condition of castArray(include))rule.include.add(condition);
167
- if (exclude) for (let condition of castArray(exclude))rule.exclude.add(condition);
168
- rule.test(SCRIPT_REGEX).use(CHAIN_ID.USE.BABEL).loader(babelLoader).options(babelOptions);
169
- } else chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).use(CHAIN_ID.USE.BABEL).after(CHAIN_ID.USE.SWC).loader(babelLoader).options(babelOptions);
170
- }
171
- });
172
- }
173
- });
174
- })(), exports.PLUGIN_BABEL_NAME = __webpack_exports__.PLUGIN_BABEL_NAME, exports.getBabelUtils = __webpack_exports__.getBabelUtils, exports.getDefaultBabelOptions = __webpack_exports__.getDefaultBabelOptions, exports.modifyBabelLoaderOptions = __webpack_exports__.modifyBabelLoaderOptions, exports.pluginBabel = __webpack_exports__.pluginBabel, __webpack_exports__)-1 === [
173
+ });
174
+ for(var __rspack_i in exports.PLUGIN_BABEL_NAME = __webpack_exports__.PLUGIN_BABEL_NAME, exports.getBabelUtils = __webpack_exports__.getBabelUtils, exports.getDefaultBabelOptions = __webpack_exports__.getDefaultBabelOptions, exports.modifyBabelLoaderOptions = __webpack_exports__.modifyBabelLoaderOptions, exports.pluginBabel = __webpack_exports__.pluginBabel, __webpack_exports__)-1 === [
175
175
  "PLUGIN_BABEL_NAME",
176
176
  "getBabelUtils",
177
177
  "getDefaultBabelOptions",
178
178
  "modifyBabelLoaderOptions",
179
179
  "pluginBabel"
180
- ].indexOf(__webpack_i__) && (exports[__webpack_i__] = __webpack_exports__[__webpack_i__]);
180
+ ].indexOf(__rspack_i) && (exports[__rspack_i] = __webpack_exports__[__rspack_i]);
181
181
  Object.defineProperty(exports, '__esModule', {
182
182
  value: !0
183
183
  });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { pluginBabel, getDefaultBabelOptions, PLUGIN_BABEL_NAME, } from './plugin.js';
2
1
  export { getBabelUtils, modifyBabelLoaderOptions } from './helper.js';
3
- export type { PresetEnvOptions, PresetEnvTargets, PresetEnvBuiltIns, BabelConfigUtils, BabelTransformOptions, PluginBabelOptions, } from './types.js';
2
+ export { getDefaultBabelOptions, PLUGIN_BABEL_NAME, pluginBabel, } from './plugin.js';
3
+ export type { BabelConfigUtils, BabelTransformOptions, PluginBabelOptions, PresetEnvBuiltIns, PresetEnvOptions, PresetEnvTargets, } from './types.js';
package/dist/index.js CHANGED
@@ -1,31 +1,13 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
2
- import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
3
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
4
- import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
5
- import * as __WEBPACK_EXTERNAL_MODULE_deepmerge__ from "deepmerge";
6
- import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__ from "reduce-configs";
7
- import * as __WEBPACK_EXTERNAL_MODULE_upath__ from "upath";
1
+ import node_path, { isAbsolute, join, normalize, sep } from "node:path";
2
+ import { reduceConfigsWithContext } from "reduce-configs";
3
+ import upath from "upath";
4
+ import node_fs from "node:fs";
5
+ import { createRequire } from "node:module";
6
+ import { fileURLToPath } from "node:url";
7
+ import deepmerge from "deepmerge";
8
8
  let BABEL_JS_RULE = 'babel-js', castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
9
9
  arr
10
- ], normalizeToPosixPath = (p)=>__WEBPACK_EXTERNAL_MODULE_upath__.default.normalizeSafe((0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.normalize)(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`), formatPath = (originPath)=>(0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.isAbsolute)(originPath) ? originPath.split(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.sep).join('/') : originPath, getPluginItemName = (item)=>'string' == typeof item ? formatPath(item) : Array.isArray(item) && 'string' == typeof item[0] ? formatPath(item[0]) : null, addPlugins = (plugins, config)=>{
11
- config.plugins ? config.plugins.push(...plugins) : config.plugins = plugins;
12
- }, addPresets = (presets, config)=>{
13
- config.presets ? config.presets.push(...presets) : config.presets = presets;
14
- }, removePlugins = (plugins, config)=>{
15
- if (!config.plugins) return;
16
- let removeList = castArray(plugins);
17
- config.plugins = config.plugins.filter((item)=>{
18
- let name = getPluginItemName(item);
19
- return !name || !removeList.find((removeItem)=>name.includes(removeItem));
20
- });
21
- }, removePresets = (presets, config)=>{
22
- if (!config.presets) return;
23
- let removeList = castArray(presets);
24
- config.presets = config.presets.filter((item)=>{
25
- let name = getPluginItemName(item);
26
- return !name || !removeList.find((removeItem)=>name.includes(removeItem));
27
- });
28
- }, modifyPresetOptions = (presetName, options, presets = [])=>{
10
+ ], normalizeToPosixPath = (p)=>upath.normalizeSafe(normalize(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`), formatPath = (originPath)=>isAbsolute(originPath) ? originPath.split(sep).join('/') : originPath, getPluginItemName = (item)=>'string' == typeof item ? formatPath(item) : Array.isArray(item) && 'string' == typeof item[0] ? formatPath(item[0]) : null, modifyPresetOptions = (presetName, options, presets = [])=>{
29
11
  presets.forEach((preset, index)=>{
30
12
  Array.isArray(preset) ? 'string' == typeof preset[0] && normalizeToPosixPath(preset[0]).includes(presetName) && (preset[1] = {
31
13
  ...preset[1] || {},
@@ -38,28 +20,41 @@ let BABEL_JS_RULE = 'babel-js', castArray = (arr)=>void 0 === arr ? [] : Array.i
38
20
  }, getBabelUtils = (config)=>{
39
21
  let noop = ()=>{};
40
22
  return {
41
- addPlugins: (plugins)=>addPlugins(plugins, config),
42
- addPresets: (presets)=>addPresets(presets, config),
43
- removePlugins: (plugins)=>removePlugins(plugins, config),
44
- removePresets: (presets)=>removePresets(presets, config),
23
+ addPlugins: (plugins)=>{
24
+ config.plugins ? config.plugins.push(...plugins) : config.plugins = plugins;
25
+ },
26
+ addPresets: (presets)=>{
27
+ config.presets ? config.presets.push(...presets) : config.presets = presets;
28
+ },
29
+ removePlugins: (plugins)=>{
30
+ ((plugins, config)=>{
31
+ if (!config.plugins) return;
32
+ let removeList = castArray(plugins);
33
+ config.plugins = config.plugins.filter((item)=>{
34
+ let name = getPluginItemName(item);
35
+ return !name || !removeList.find((removeItem)=>name.includes(removeItem));
36
+ });
37
+ })(plugins, config);
38
+ },
39
+ removePresets: (presets)=>{
40
+ ((presets, config)=>{
41
+ if (!config.presets) return;
42
+ let removeList = castArray(presets);
43
+ config.presets = config.presets.filter((item)=>{
44
+ let name = getPluginItemName(item);
45
+ return !name || !removeList.find((removeItem)=>name.includes(removeItem));
46
+ });
47
+ })(presets, config);
48
+ },
45
49
  addIncludes: noop,
46
50
  addExcludes: noop,
47
- modifyPresetEnvOptions: (options)=>modifyPresetOptions('@babel/preset-env', options, config.presets || []),
48
- modifyPresetReactOptions: (options)=>modifyPresetOptions('@babel/preset-react', options, config.presets || [])
51
+ modifyPresetEnvOptions: (options)=>{
52
+ modifyPresetOptions('@babel/preset-env', options, config.presets || []);
53
+ },
54
+ modifyPresetReactOptions: (options)=>{
55
+ modifyPresetOptions('@babel/preset-react', options, config.presets || []);
56
+ }
49
57
  };
50
- }, applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils)=>{
51
- if (userBabelConfig) {
52
- let babelUtils = {
53
- ...getBabelUtils(defaultOptions),
54
- ...extraBabelUtils
55
- };
56
- return (0, __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__.reduceConfigsWithContext)({
57
- initial: defaultOptions,
58
- config: userBabelConfig,
59
- ctx: babelUtils
60
- });
61
- }
62
- return defaultOptions;
63
58
  }, modifyBabelLoaderOptions = ({ chain, CHAIN_ID, modifier })=>{
64
59
  for (let ruleId of [
65
60
  CHAIN_ID.RULE.JS,
@@ -69,15 +64,18 @@ let BABEL_JS_RULE = 'babel-js', castArray = (arr)=>void 0 === arr ? [] : Array.i
69
64
  let rule = chain.module.rule(ruleId);
70
65
  rule.uses.has(CHAIN_ID.USE.BABEL) && rule.use(CHAIN_ID.USE.BABEL).tap(modifier);
71
66
  }
72
- }, plugin_dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url)), plugin_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url), PLUGIN_BABEL_NAME = 'rsbuild:babel', SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
67
+ }, plugin_dirname = node_path.dirname(fileURLToPath(import.meta.url)), plugin_require = createRequire(import.meta.url), PLUGIN_BABEL_NAME = 'rsbuild:babel', SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = {
73
68
  allowNamespaces: !0,
74
69
  allExtensions: !0,
75
70
  allowDeclareFields: !0,
76
71
  optimizeConstEnums: !0,
77
72
  isTSX: !0
78
73
  };
74
+ function getCacheDirectory(context, cacheDirectory) {
75
+ return cacheDirectory ? isAbsolute(cacheDirectory) ? cacheDirectory : join(context.rootPath, cacheDirectory) : join(context.cachePath);
76
+ }
79
77
  async function getCacheIdentifier(options) {
80
- let identifier = `${process.env.NODE_ENV}${JSON.stringify(options)}`, { version: coreVersion } = await import("@babel/core"), loaderVersion = JSON.parse(await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.readFile((0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(plugin_dirname, '../compiled/babel-loader/package.json'), 'utf-8')).version ?? '';
78
+ let identifier = `${process.env.NODE_ENV}${JSON.stringify(options)}`, { version: coreVersion } = await import("@babel/core"), loaderVersion = JSON.parse(await node_fs.promises.readFile(join(plugin_dirname, '../compiled/babel-loader/package.json'), 'utf-8')).version ?? '';
81
79
  return identifier + `@babel/core@${coreVersion}babel-loader@${loaderVersion}`;
82
80
  }
83
81
  let getDefaultBabelOptions = (config, context)=>{
@@ -102,22 +100,34 @@ let getDefaultBabelOptions = (config, context)=>{
102
100
  ]
103
101
  }, { buildCache = !0 } = config.performance;
104
102
  if (buildCache && 'rspack' === context.bundlerType) {
105
- var cacheDirectory;
106
- let cacheDirectory1 = (cacheDirectory = 'boolean' == typeof buildCache ? void 0 : buildCache.cacheDirectory) ? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.isAbsolute)(cacheDirectory) ? cacheDirectory : (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(context.rootPath, cacheDirectory) : (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(context.cachePath);
107
- options.cacheCompression = !1, options.cacheDirectory = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(cacheDirectory1, 'babel-loader');
103
+ let cacheDirectory = getCacheDirectory(context, 'boolean' == typeof buildCache ? void 0 : buildCache.cacheDirectory);
104
+ options.cacheCompression = !1, options.cacheDirectory = join(cacheDirectory, 'babel-loader');
108
105
  }
109
106
  return options;
110
107
  }, pluginBabel = (options = {})=>({
111
108
  name: PLUGIN_BABEL_NAME,
112
109
  setup (api) {
113
110
  let getBabelOptions = async (environment)=>{
114
- let { config } = environment, baseOptions = getDefaultBabelOptions(config, api.context), mergedOptions = applyUserBabelConfig((0, __WEBPACK_EXTERNAL_MODULE_deepmerge__.default)({}, baseOptions), options.babelLoaderOptions);
111
+ let { config } = environment, mergedOptions = ((defaultOptions, userBabelConfig, extraBabelUtils)=>{
112
+ if (userBabelConfig) {
113
+ let babelUtils = {
114
+ ...getBabelUtils(defaultOptions),
115
+ ...void 0
116
+ };
117
+ return reduceConfigsWithContext({
118
+ initial: defaultOptions,
119
+ config: userBabelConfig,
120
+ ctx: babelUtils
121
+ });
122
+ }
123
+ return defaultOptions;
124
+ })(deepmerge({}, getDefaultBabelOptions(config, api.context)), options.babelLoaderOptions);
115
125
  return mergedOptions.cacheDirectory && !mergedOptions.cacheIdentifier && (mergedOptions.cacheIdentifier = await getCacheIdentifier(mergedOptions)), mergedOptions;
116
126
  };
117
127
  api.modifyBundlerChain({
118
128
  order: 'pre',
119
129
  handler: async (chain, { CHAIN_ID, environment })=>{
120
- let babelOptions = await getBabelOptions(environment), babelLoader = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.resolve(plugin_dirname, '../compiled/babel-loader/index.js'), { include, exclude } = options;
130
+ let babelOptions = await getBabelOptions(environment), babelLoader = node_path.resolve(plugin_dirname, '../compiled/babel-loader/index.js'), { include, exclude } = options;
121
131
  if (include || exclude) {
122
132
  let rule = chain.module.rule(BABEL_JS_RULE).after(CHAIN_ID.RULE.JS);
123
133
  if (include) for (let condition of castArray(include))rule.include.add(condition);
package/dist/plugin.d.ts CHANGED
@@ -1,15 +1,5 @@
1
1
  import type { NormalizedEnvironmentConfig, RsbuildContext, RsbuildPlugin } from '@rsbuild/core';
2
2
  import type { BabelLoaderOptions, PluginBabelOptions } from './types.js';
3
3
  export declare const PLUGIN_BABEL_NAME = "rsbuild:babel";
4
- /**
5
- * The `@babel/preset-typescript` default options.
6
- */
7
- export declare const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS: {
8
- allowNamespaces: boolean;
9
- allExtensions: boolean;
10
- allowDeclareFields: boolean;
11
- optimizeConstEnums: boolean;
12
- isTSX: boolean;
13
- };
14
4
  export declare const getDefaultBabelOptions: (config: NormalizedEnvironmentConfig, context: RsbuildContext) => BabelLoaderOptions;
15
5
  export declare const pluginBabel: (options?: PluginBabelOptions) => RsbuildPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-babel",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Babel plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,35 +23,35 @@
23
23
  "compiled"
24
24
  ],
25
25
  "dependencies": {
26
- "@babel/core": "^7.26.10",
27
- "@babel/plugin-proposal-decorators": "^7.25.9",
28
- "@babel/plugin-transform-class-properties": "^7.25.9",
29
- "@babel/preset-typescript": "^7.27.0",
26
+ "@babel/core": "^7.28.5",
27
+ "@babel/plugin-proposal-decorators": "^7.28.0",
28
+ "@babel/plugin-transform-class-properties": "^7.27.1",
29
+ "@babel/preset-typescript": "^7.28.5",
30
30
  "@types/babel__core": "^7.20.5",
31
31
  "deepmerge": "^4.3.1",
32
- "reduce-configs": "^1.1.0",
32
+ "reduce-configs": "^1.1.1",
33
33
  "upath": "2.0.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@rslib/core": "0.6.1",
37
- "@types/node": "^22.14.0",
36
+ "@rslib/core": "0.19.1",
37
+ "@types/node": "^24.10.4",
38
38
  "babel-loader": "10.0.0",
39
- "prebundle": "1.3.3",
40
- "typescript": "^5.8.3",
41
- "@rsbuild/core": "1.3.5",
39
+ "prebundle": "1.6.0",
40
+ "typescript": "^5.9.3",
41
+ "@rsbuild/core": "1.7.2",
42
42
  "@scripts/test-helper": "1.0.1"
43
43
  },
44
44
  "peerDependencies": {
45
- "@rsbuild/core": "1.x"
45
+ "@rsbuild/core": "^1.0.0 || ^2.0.0-0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public",
49
- "provenance": true,
50
49
  "registry": "https://registry.npmjs.org/"
51
50
  },
52
51
  "scripts": {
53
52
  "build": "rslib build",
54
- "dev": "rslib build --watch",
55
- "prebundle": "prebundle"
53
+ "dev": "rslib build -w",
54
+ "prebundle": "prebundle",
55
+ "bump": "pnpx bumpp --no-tag"
56
56
  }
57
57
  }
@@ -1 +0,0 @@
1
- module.exports.validate = () => {};