diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index de8667e2f5..d7a9bcf422 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -2,5 +2,4 @@ export const PLUGIN_SWC_NAME = 'rsbuild:swc'; export const PLUGIN_CSS_NAME = 'rsbuild:css'; export const PLUGIN_LESS_NAME = 'rsbuild:less'; export const PLUGIN_SASS_NAME = 'rsbuild:sass'; -export const PLUGIN_BABEL_NAME = 'rsbuild:babel'; export const PLUGIN_STYLUS_NAME = 'rsbuild:stylus'; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 7a583a99d6..4e767ff377 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -19,7 +19,6 @@ export { PLUGIN_CSS_NAME, PLUGIN_SASS_NAME, PLUGIN_LESS_NAME, - PLUGIN_BABEL_NAME, PLUGIN_STYLUS_NAME, } from './constants'; diff --git a/packages/plugin-babel/src/plugin.ts b/packages/plugin-babel/src/plugin.ts index 5d29b9517e..64a7da907c 100644 --- a/packages/plugin-babel/src/plugin.ts +++ b/packages/plugin-babel/src/plugin.ts @@ -1,15 +1,17 @@ import path from 'node:path'; -import { PLUGIN_BABEL_NAME, type RsbuildPlugin } from '@rsbuild/core'; +import type { RsbuildPlugin } from '@rsbuild/core'; import { + isProd, castArray, cloneDeep, SCRIPT_REGEX, - isProd, type Decorators, } from '@rsbuild/shared'; import { applyUserBabelConfig, BABEL_JS_RULE } from './helper'; import type { PluginBabelOptions } from './types'; +export const PLUGIN_BABEL_NAME = 'rsbuild:babel'; + /** * The `@babel/preset-typescript` default options. */ @@ -41,8 +43,6 @@ export const getDefaultBabelOptions = (decorators: Decorators) => { }; }; -export { PLUGIN_BABEL_NAME }; - export const pluginBabel = ( options: PluginBabelOptions = {}, ): RsbuildPlugin => ({