Skip to content

Commit

Permalink
chore: clear some useless utils (#2854)
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy authored Jul 9, 2024
1 parent 6ed6a2e commit 8d45e88
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions packages/core/src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export type DeepReadonly<T> = keyof T extends never
? T
: { readonly [k in keyof T]: DeepReadonly<T[k]> };

export type FileFilterUtil = (items: OneOrMany<string | RegExp>) => void;

export type ConfigChain<T> = OneOrMany<T | ((config: T) => T | void)>;

export type ConfigChainWithContext<T, Ctx> = OneOrMany<
Expand Down
16 changes: 1 addition & 15 deletions packages/plugin-babel/src/helper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { isAbsolute, normalize, sep } from 'node:path';
import type { PluginOptions as BabelPluginOptions } from '@babel/core';
import type {
ChainIdentifier,
NormalizedConfig,
RspackChain,
} from '@rsbuild/core';
import type { ChainIdentifier, RspackChain } from '@rsbuild/core';
import { reduceConfigsWithContext } from 'reduce-configs';
import upath from 'upath';
import type {
Expand Down Expand Up @@ -176,16 +172,6 @@ export const applyUserBabelConfig = (
return defaultOptions;
};

export const getUseBuiltIns = (
config: NormalizedConfig,
): false | 'usage' | 'entry' => {
const { polyfill } = config.output;
if (polyfill === 'off') {
return false;
}
return polyfill;
};

export const modifyBabelLoaderOptions = ({
chain,
CHAIN_ID,
Expand Down
6 changes: 1 addition & 5 deletions packages/plugin-babel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ export {
getDefaultBabelOptions,
PLUGIN_BABEL_NAME,
} from './plugin';
export {
getBabelUtils,
getUseBuiltIns,
modifyBabelLoaderOptions,
} from './helper';
export { getBabelUtils, modifyBabelLoaderOptions } from './helper';
export type {
PresetEnvOptions,
PresetEnvTargets,
Expand Down

0 comments on commit 8d45e88

Please sign in to comment.