@rsbuild/plugin-babel
Advanced tools
Comparing version
(() => { | ||
var __webpack_modules__ = { | ||
666: (module) => { | ||
73: (module) => { | ||
const STRIP_FILENAME_RE = /^[^:]+: /; | ||
@@ -29,13 +29,13 @@ const format = (err) => { | ||
}, | ||
598: (module, __unused_webpack_exports, __nccwpck_require__) => { | ||
const os = __nccwpck_require__(37); | ||
const path = __nccwpck_require__(17); | ||
const zlib = __nccwpck_require__(796); | ||
const crypto = __nccwpck_require__(113); | ||
const { promisify } = __nccwpck_require__(837); | ||
const { readFile, writeFile, mkdir } = __nccwpck_require__(292); | ||
805: (module, __unused_webpack_exports, __nccwpck_require__) => { | ||
const os = __nccwpck_require__(857); | ||
const path = __nccwpck_require__(928); | ||
const zlib = __nccwpck_require__(106); | ||
const crypto = __nccwpck_require__(982); | ||
const { promisify } = __nccwpck_require__(23); | ||
const { readFile, writeFile, mkdir } = __nccwpck_require__(943); | ||
const findCacheDirP = __nccwpck_require__ | ||
.e(672) | ||
.then(__nccwpck_require__.bind(__nccwpck_require__, 672)); | ||
const transform = __nccwpck_require__(470); | ||
.e(611) | ||
.then(__nccwpck_require__.bind(__nccwpck_require__, 611)); | ||
const transform = __nccwpck_require__(723); | ||
let defaultCacheDirectory = null; | ||
@@ -126,6 +126,6 @@ let hashType = "sha256"; | ||
}, | ||
769: (module, __unused_webpack_exports, __nccwpck_require__) => { | ||
603: (module, __unused_webpack_exports, __nccwpck_require__) => { | ||
let babel; | ||
try { | ||
babel = __nccwpck_require__(718); | ||
babel = __nccwpck_require__(571); | ||
} catch (err) { | ||
@@ -145,9 +145,9 @@ if (err.code === "MODULE_NOT_FOUND") { | ||
} | ||
const { version } = __nccwpck_require__(684); | ||
const cache = __nccwpck_require__(598); | ||
const transform = __nccwpck_require__(470); | ||
const injectCaller = __nccwpck_require__(172); | ||
const schema = __nccwpck_require__(383); | ||
const { isAbsolute } = __nccwpck_require__(17); | ||
const validateOptions = __nccwpck_require__(14).validate; | ||
const { version } = __nccwpck_require__(344); | ||
const cache = __nccwpck_require__(805); | ||
const transform = __nccwpck_require__(723); | ||
const injectCaller = __nccwpck_require__(273); | ||
const schema = __nccwpck_require__(291); | ||
const { isAbsolute } = __nccwpck_require__(928); | ||
const validateOptions = __nccwpck_require__(979).validate; | ||
function subscribe(subscriber, metadata, context) { | ||
@@ -333,3 +333,3 @@ if (context[subscriber]) { | ||
}, | ||
172: (module) => { | ||
273: (module) => { | ||
module.exports = function injectCaller(opts, target) { | ||
@@ -350,6 +350,6 @@ return Object.assign({}, opts, { | ||
}, | ||
470: (module, __unused_webpack_exports, __nccwpck_require__) => { | ||
const babel = __nccwpck_require__(718); | ||
const { promisify } = __nccwpck_require__(837); | ||
const LoaderError = __nccwpck_require__(666); | ||
723: (module, __unused_webpack_exports, __nccwpck_require__) => { | ||
const babel = __nccwpck_require__(571); | ||
const { promisify } = __nccwpck_require__(23); | ||
const LoaderError = __nccwpck_require__(73); | ||
const transform = promisify(babel.transform); | ||
@@ -380,55 +380,55 @@ module.exports = async function (source, options) { | ||
}, | ||
684: (module) => { | ||
344: (module) => { | ||
"use strict"; | ||
module.exports = require("./package.json"); | ||
}, | ||
14: (module) => { | ||
979: (module) => { | ||
"use strict"; | ||
module.exports = require("./schema-utils"); | ||
}, | ||
718: (module) => { | ||
571: (module) => { | ||
"use strict"; | ||
module.exports = require("@babel/core"); | ||
}, | ||
113: (module) => { | ||
982: (module) => { | ||
"use strict"; | ||
module.exports = require("crypto"); | ||
}, | ||
292: (module) => { | ||
943: (module) => { | ||
"use strict"; | ||
module.exports = require("fs/promises"); | ||
}, | ||
561: (module) => { | ||
24: (module) => { | ||
"use strict"; | ||
module.exports = require("node:fs"); | ||
}, | ||
411: (module) => { | ||
760: (module) => { | ||
"use strict"; | ||
module.exports = require("node:path"); | ||
}, | ||
742: (module) => { | ||
708: (module) => { | ||
"use strict"; | ||
module.exports = require("node:process"); | ||
}, | ||
41: (module) => { | ||
136: (module) => { | ||
"use strict"; | ||
module.exports = require("node:url"); | ||
}, | ||
37: (module) => { | ||
857: (module) => { | ||
"use strict"; | ||
module.exports = require("os"); | ||
}, | ||
17: (module) => { | ||
928: (module) => { | ||
"use strict"; | ||
module.exports = require("path"); | ||
}, | ||
837: (module) => { | ||
23: (module) => { | ||
"use strict"; | ||
module.exports = require("util"); | ||
}, | ||
796: (module) => { | ||
106: (module) => { | ||
"use strict"; | ||
module.exports = require("zlib"); | ||
}, | ||
383: (module) => { | ||
291: (module) => { | ||
"use strict"; | ||
@@ -504,3 +504,3 @@ module.exports = JSON.parse( | ||
(() => { | ||
var installedChunks = { 179: 1 }; | ||
var installedChunks = { 792: 1 }; | ||
var installChunk = (chunk) => { | ||
@@ -527,4 +527,4 @@ var moreModules = chunk.modules, | ||
})(); | ||
var __webpack_exports__ = __nccwpck_require__(769); | ||
var __webpack_exports__ = __nccwpck_require__(603); | ||
module.exports = __webpack_exports__; | ||
})(); |
@@ -1,69 +0,40 @@ | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_fs__ from "node:fs"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_url__ from "node:url"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_deepmerge__ from "deepmerge"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs__ from "reduce-configs"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__ from "reduce-configs"; | ||
import * as __WEBPACK_EXTERNAL_MODULE_upath__ from "upath"; | ||
const BABEL_JS_RULE = 'babel-js'; | ||
const castArray = (arr)=>{ | ||
if (void 0 === arr) return []; | ||
return Array.isArray(arr) ? arr : [ | ||
let BABEL_JS_RULE = 'babel-js', castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [ | ||
arr | ||
]; | ||
}; | ||
const normalizeToPosixPath = (p)=>__WEBPACK_EXTERNAL_MODULE_upath__["default"].normalizeSafe((0, __WEBPACK_EXTERNAL_MODULE_node_path__.normalize)(p || '')).replace(/^([a-zA-Z]+):/, (_, m)=>`/${m.toLowerCase()}`); | ||
// compatible with Windows path | ||
const formatPath = (originPath)=>{ | ||
if ((0, __WEBPACK_EXTERNAL_MODULE_node_path__.isAbsolute)(originPath)) return originPath.split(__WEBPACK_EXTERNAL_MODULE_node_path__.sep).join('/'); | ||
return originPath; | ||
}; | ||
const getPluginItemName = (item)=>{ | ||
if ('string' == typeof item) return formatPath(item); | ||
if (Array.isArray(item) && 'string' == typeof item[0]) return formatPath(item[0]); | ||
return null; | ||
}; | ||
const addPlugins = (plugins, config)=>{ | ||
if (config.plugins) config.plugins.push(...plugins); | ||
else config.plugins = plugins; | ||
}; | ||
const addPresets = (presets, config)=>{ | ||
if (config.presets) config.presets.push(...presets); | ||
else config.presets = presets; | ||
}; | ||
const removePlugins = (plugins, config)=>{ | ||
], 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)=>{ | ||
config.plugins ? config.plugins.push(...plugins) : config.plugins = plugins; | ||
}, addPresets = (presets, config)=>{ | ||
config.presets ? config.presets.push(...presets) : config.presets = presets; | ||
}, removePlugins = (plugins, config)=>{ | ||
if (!config.plugins) return; | ||
const removeList = castArray(plugins); | ||
let removeList = castArray(plugins); | ||
config.plugins = config.plugins.filter((item)=>{ | ||
const name = getPluginItemName(item); | ||
if (name) return !removeList.find((removeItem)=>name.includes(removeItem)); | ||
return true; | ||
let name = getPluginItemName(item); | ||
return !name || !removeList.find((removeItem)=>name.includes(removeItem)); | ||
}); | ||
}; | ||
const removePresets = (presets, config)=>{ | ||
}, removePresets = (presets, config)=>{ | ||
if (!config.presets) return; | ||
const removeList = castArray(presets); | ||
let removeList = castArray(presets); | ||
config.presets = config.presets.filter((item)=>{ | ||
const name = getPluginItemName(item); | ||
if (name) return !removeList.find((removeItem)=>name.includes(removeItem)); | ||
return true; | ||
let name = getPluginItemName(item); | ||
return !name || !removeList.find((removeItem)=>name.includes(removeItem)); | ||
}); | ||
}; | ||
const modifyPresetOptions = (presetName, options, presets = [])=>{ | ||
}, modifyPresetOptions = (presetName, options, presets = [])=>{ | ||
presets.forEach((preset, index)=>{ | ||
// 1. ['@babel/preset-env', ...] | ||
if (Array.isArray(preset)) { | ||
if ('string' == typeof preset[0] && normalizeToPosixPath(preset[0]).includes(presetName)) preset[1] = { | ||
...preset[1] || {}, | ||
...options | ||
}; | ||
} else if ('string' == typeof preset && normalizeToPosixPath(preset).includes(presetName)) // 2. '@babel/preset-env' | ||
presets[index] = [ | ||
Array.isArray(preset) ? 'string' == typeof preset[0] && normalizeToPosixPath(preset[0]).includes(presetName) && (preset[1] = { | ||
...preset[1] || {}, | ||
...options | ||
}) : 'string' == typeof preset && normalizeToPosixPath(preset).includes(presetName) && (presets[index] = [ | ||
preset, | ||
options | ||
]; | ||
]); | ||
}); | ||
}; | ||
const getBabelUtils = (config)=>{ | ||
const noop = ()=>{}; | ||
}, getBabelUtils = (config)=>{ | ||
let noop = ()=>{}; | ||
return { | ||
@@ -74,18 +45,14 @@ addPlugins: (plugins)=>addPlugins(plugins, config), | ||
removePresets: (presets)=>removePresets(presets, config), | ||
// `addIncludes` and `addExcludes` are noop functions by default, | ||
// It can be overridden by `extraBabelUtils`. | ||
addIncludes: noop, | ||
addExcludes: noop, | ||
// Compat `presetEnvOptions` and `presetReactOptions` in Modern.js | ||
modifyPresetEnvOptions: (options)=>modifyPresetOptions('@babel/preset-env', options, config.presets || []), | ||
modifyPresetReactOptions: (options)=>modifyPresetOptions('@babel/preset-react', options, config.presets || []) | ||
}; | ||
}; | ||
const applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils)=>{ | ||
}, applyUserBabelConfig = (defaultOptions, userBabelConfig, extraBabelUtils)=>{ | ||
if (userBabelConfig) { | ||
const babelUtils = { | ||
let babelUtils = { | ||
...getBabelUtils(defaultOptions), | ||
...extraBabelUtils | ||
}; | ||
return (0, __WEBPACK_EXTERNAL_MODULE_reduce_configs__.reduceConfigsWithContext)({ | ||
return (0, __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__.reduceConfigsWithContext)({ | ||
initial: defaultOptions, | ||
@@ -97,47 +64,26 @@ config: userBabelConfig, | ||
return defaultOptions; | ||
}; | ||
const modifyBabelLoaderOptions = ({ chain, CHAIN_ID, modifier })=>{ | ||
const ruleIds = [ | ||
}, modifyBabelLoaderOptions = ({ chain, CHAIN_ID, modifier })=>{ | ||
for (let ruleId of [ | ||
CHAIN_ID.RULE.JS, | ||
CHAIN_ID.RULE.JS_DATA_URI, | ||
BABEL_JS_RULE | ||
]; | ||
for (const ruleId of ruleIds)if (chain.module.rules.has(ruleId)) { | ||
const rule = chain.module.rule(ruleId); | ||
if (rule.uses.has(CHAIN_ID.USE.BABEL)) rule.use(CHAIN_ID.USE.BABEL).tap(modifier); | ||
])if (chain.module.rules.has(ruleId)) { | ||
let rule = chain.module.rule(ruleId); | ||
rule.uses.has(CHAIN_ID.USE.BABEL) && rule.use(CHAIN_ID.USE.BABEL).tap(modifier); | ||
} | ||
}, 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 = { | ||
allowNamespaces: !0, | ||
allExtensions: !0, | ||
allowDeclareFields: !0, | ||
optimizeConstEnums: !0, | ||
isTSX: !0 | ||
}; | ||
const plugin_dirname = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url__.fileURLToPath)(import.meta.url)); | ||
const plugin_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url); | ||
const PLUGIN_BABEL_NAME = 'rsbuild:babel'; | ||
const SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/; | ||
/** | ||
* The `@babel/preset-typescript` default options. | ||
*/ const DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS = { | ||
allowNamespaces: true, | ||
allExtensions: true, | ||
allowDeclareFields: true, | ||
// aligns Babel's behavior with TypeScript's default behavior. | ||
// https://babeljs.io/docs/en/babel-preset-typescript#optimizeconstenums | ||
optimizeConstEnums: true, | ||
isTSX: true | ||
}; | ||
function getCacheDirectory(context, cacheDirectory) { | ||
if (cacheDirectory) return (0, __WEBPACK_EXTERNAL_MODULE_node_path__.isAbsolute)(cacheDirectory) ? cacheDirectory : (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(context.rootPath, cacheDirectory); | ||
return (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(context.cachePath); | ||
} | ||
async function getCacheIdentifier(options) { | ||
let identifier = `${process.env.NODE_ENV}${JSON.stringify(options)}`; | ||
const { version: coreVersion } = await import("@babel/core"); | ||
const rawPkgJson = await __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].promises.readFile((0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(plugin_dirname, '../compiled/babel-loader/package.json'), 'utf-8'); | ||
const loaderVersion = JSON.parse(rawPkgJson).version ?? ''; | ||
identifier += `@babel/core@${coreVersion}`; | ||
identifier += `babel-loader@${loaderVersion}`; | ||
return identifier; | ||
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 ?? ''; | ||
return identifier + `@babel/core@${coreVersion}babel-loader@${loaderVersion}`; | ||
} | ||
const getDefaultBabelOptions = (config, context)=>{ | ||
const isLegacyDecorators = 'legacy' === config.source.decorators.version; | ||
const options = { | ||
babelrc: false, | ||
configFile: false, | ||
let getDefaultBabelOptions = (config, context)=>{ | ||
let isLegacyDecorators = 'legacy' === config.source.decorators.version, options = { | ||
babelrc: !1, | ||
configFile: !1, | ||
compact: 'production' === config.mode, | ||
@@ -149,4 +95,2 @@ plugins: [ | ||
], | ||
// If you are using @babel/preset-env and legacy decorators, you must ensure the class elements transform is enabled regardless of your targets, because Babel only supports compiling legacy decorators when also compiling class properties: | ||
// see https://babeljs.io/docs/babel-plugin-proposal-decorators#legacy | ||
...isLegacyDecorators ? [ | ||
@@ -157,30 +101,20 @@ plugin_require.resolve('@babel/plugin-transform-class-properties') | ||
presets: [ | ||
// TODO: only apply preset-typescript for ts file (isTSX & allExtensions false) | ||
[ | ||
plugin_require.resolve('@babel/preset-typescript'), | ||
plugin_require.resolve("@babel/preset-typescript"), | ||
DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS | ||
] | ||
] | ||
}; | ||
const { buildCache } = config.performance; | ||
// Rspack does not yet support persistent cache | ||
// so we use babel-loader's cache to improve rebuild performance | ||
}, { buildCache = !0 } = config.performance; | ||
if (buildCache && 'rspack' === context.bundlerType) { | ||
const cacheDirectory = getCacheDirectory(context, 'boolean' == typeof buildCache ? void 0 : buildCache.cacheDirectory); | ||
// turn off compression to reduce overhead | ||
options.cacheCompression = false; | ||
options.cacheDirectory = (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(cacheDirectory, 'babel-loader'); | ||
var cacheDirectory; | ||
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); | ||
options.cacheCompression = !1, options.cacheDirectory = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(cacheDirectory1, 'babel-loader'); | ||
} | ||
return options; | ||
}; | ||
const pluginBabel = (options = {})=>({ | ||
}, pluginBabel = (options = {})=>({ | ||
name: PLUGIN_BABEL_NAME, | ||
setup (api) { | ||
const getBabelOptions = async (environment)=>{ | ||
const { config } = environment; | ||
const baseOptions = getDefaultBabelOptions(config, api.context); | ||
const mergedOptions = applyUserBabelConfig((0, __WEBPACK_EXTERNAL_MODULE_deepmerge__["default"])({}, baseOptions), options.babelLoaderOptions); | ||
// calculate cacheIdentifier with the merged options | ||
if (mergedOptions.cacheDirectory && !mergedOptions.cacheIdentifier) mergedOptions.cacheIdentifier = await getCacheIdentifier(mergedOptions); | ||
return mergedOptions; | ||
let getBabelOptions = async (environment)=>{ | ||
let { config } = environment, baseOptions = getDefaultBabelOptions(config, api.context), mergedOptions = applyUserBabelConfig((0, __WEBPACK_EXTERNAL_MODULE_deepmerge__.default)({}, baseOptions), options.babelLoaderOptions); | ||
return mergedOptions.cacheDirectory && !mergedOptions.cacheIdentifier && (mergedOptions.cacheIdentifier = await getCacheIdentifier(mergedOptions)), mergedOptions; | ||
}; | ||
@@ -190,17 +124,9 @@ api.modifyBundlerChain({ | ||
handler: async (chain, { CHAIN_ID, environment })=>{ | ||
const babelOptions = await getBabelOptions(environment); | ||
const babelLoader = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(plugin_dirname, '../compiled/babel-loader/index.js'); | ||
const { include, exclude } = options; | ||
let babelOptions = await getBabelOptions(environment), babelLoader = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.resolve(plugin_dirname, '../compiled/babel-loader/index.js'), { include, exclude } = options; | ||
if (include || exclude) { | ||
const rule = chain.module.rule(BABEL_JS_RULE) // run babel loader before the builtin SWC loader | ||
// https://stackoverflow.com/questions/32234329/what-is-the-loader-order-for-webpack | ||
.after(CHAIN_ID.RULE.JS); | ||
if (include) for (const condition of castArray(include))rule.include.add(condition); | ||
if (exclude) for (const condition of castArray(exclude))rule.exclude.add(condition); | ||
let rule = chain.module.rule(BABEL_JS_RULE).after(CHAIN_ID.RULE.JS); | ||
if (include) for (let condition of castArray(include))rule.include.add(condition); | ||
if (exclude) for (let condition of castArray(exclude))rule.exclude.add(condition); | ||
rule.test(SCRIPT_REGEX).use(CHAIN_ID.USE.BABEL).loader(babelLoader).options(babelOptions); | ||
} else { | ||
// already set source.include / exclude in plugin-swc | ||
const rule = chain.module.rule(CHAIN_ID.RULE.JS); | ||
rule.test(SCRIPT_REGEX).use(CHAIN_ID.USE.BABEL).after(CHAIN_ID.USE.SWC).loader(babelLoader).options(babelOptions); | ||
} | ||
} 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); | ||
} | ||
@@ -207,0 +133,0 @@ }); |
{ | ||
"name": "@rsbuild/plugin-babel", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Babel plugin for Rsbuild", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/core": "^7.26.0", | ||
"@babel/core": "^7.26.9", | ||
"@babel/plugin-proposal-decorators": "^7.25.9", | ||
@@ -33,11 +33,12 @@ "@babel/plugin-transform-class-properties": "^7.25.9", | ||
"deepmerge": "^4.3.1", | ||
"reduce-configs": "^1.0.0", | ||
"reduce-configs": "^1.1.0", | ||
"upath": "2.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "18.x", | ||
"@rslib/core": "0.4.1", | ||
"@types/node": "^22.13.4", | ||
"babel-loader": "9.2.1", | ||
"prebundle": "1.2.2", | ||
"typescript": "^5.6.3", | ||
"@rsbuild/core": "1.0.19", | ||
"prebundle": "1.2.7", | ||
"typescript": "^5.7.3", | ||
"@rsbuild/core": "1.2.9", | ||
"@scripts/test-helper": "1.0.1" | ||
@@ -44,0 +45,0 @@ }, |
@@ -1,19 +0,19 @@ | ||
<p align="center"> | ||
<a href="https://rsbuild.dev" target="blank"><img src="https://github.com/web-infra-dev/rsbuild/assets/7237365/84abc13e-b620-468f-a90b-dbf28e7e9427" alt="Rsbuild Logo" /></a> | ||
</p> | ||
# @rsbuild/plugin-babel | ||
# Rsbuild | ||
An Rsbuild plugin to use Babel to transpile the code. | ||
The Rspack-based build tool. It's fast, out-of-the-box and extensible. | ||
<p> | ||
<a href="https://npmjs.com/package/@rsbuild/plugin-babel"> | ||
<img src="https://img.shields.io/npm/v/@rsbuild/plugin-babel?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /> | ||
</a> | ||
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" /> | ||
<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> | ||
</p> | ||
## Documentation | ||
https://rsbuild.dev/ | ||
See [Documentation](https://rsbuild.dev/plugins/list/plugin-babel). | ||
## Contributing | ||
Please read the [Contributing Guide](https://github.com/web-infra-dev/rsbuild/blob/main/CONTRIBUTING.md). | ||
## License | ||
Rsbuild is [MIT licensed](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE). | ||
[MIT](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE). |
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
56994
-13.91%7
16.67%1276
-20.25%6
20%Updated
Updated