Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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