Skip to content

Commit

Permalink
chore: replace babel-preset-base with rsbuild babel-preset (#4787)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Oct 13, 2023
1 parent 4757498 commit 383b636
Show file tree
Hide file tree
Showing 84 changed files with 92 additions and 3,388 deletions.
10 changes: 10 additions & 0 deletions .changeset/forty-feet-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@modern-js/builder-rspack-provider': patch
'@modern-js/server': patch
'@modern-js/utils': patch
'@modern-js/server-utils': patch
---

chore: replace babel-preset-base with rsbuild babel-preset

chore: 替换 babel-preset-base 为 rsbuild babel-preset
15 changes: 13 additions & 2 deletions packages/builder/builder-rspack-provider/src/plugins/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,19 @@ import {
import { cloneDeep, isEqual } from '@modern-js/utils/lodash';
import { BuilderPlugin, NormalizedConfig } from '../types';
import type { BabelOptions } from '@modern-js/types';
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import { DEFAULT_BABEL_PRESET_TYPESCRIPT_OPTIONS } from '@modern-js/utils';

/**
* The `@babel/preset-typescript` default options.
*/
export 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,
};

export const builderPluginBabel = (): BuilderPlugin => ({
name: 'builder-plugin-babel',
Expand Down
9 changes: 0 additions & 9 deletions packages/cli/babel-preset-base/.eslintrc.js

This file was deleted.

31 changes: 0 additions & 31 deletions packages/cli/babel-preset-base/.npmignore

This file was deleted.

Loading

0 comments on commit 383b636

Please sign in to comment.