Skip to content

Commit

Permalink
chore: move babel plugin name constant (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Feb 1, 2024
1 parent 777c99b commit e0c1ccc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export {
PLUGIN_CSS_NAME,
PLUGIN_SASS_NAME,
PLUGIN_LESS_NAME,
PLUGIN_BABEL_NAME,
PLUGIN_STYLUS_NAME,
} from './constants';

Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-babel/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down Expand Up @@ -41,8 +43,6 @@ export const getDefaultBabelOptions = (decorators: Decorators) => {
};
};

export { PLUGIN_BABEL_NAME };

export const pluginBabel = (
options: PluginBabelOptions = {},
): RsbuildPlugin => ({
Expand Down

0 comments on commit e0c1ccc

Please sign in to comment.