Skip to content

Commit

Permalink
fix: move transform-class-properties to presets
Browse files Browse the repository at this point in the history
  • Loading branch information
melikhov-dev committed Nov 1, 2023
1 parent 47faf6a commit 7e4cb1b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/common/babel/ui-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ module.exports = function (_context: unknown, options: Record<string, any> = {})
const reactOptions = getOption(options.react, {});

const presets = [
[
() => ({
/**
* Safari 15 has a buggy implementation of class properties,
* but @babel/compat-data marks it as stable.
* Can be removed once the issue is fixed and released.
* @see https://github.com/babel/babel/issues/14289
*/
plugins: [require.resolve('@babel/plugin-transform-class-properties')],
}),
],
// Latest stable ECMAScript features
(isEnvDevelopment || isEnvProduction) && [require.resolve('@babel/preset-env'), envOptions],
// ES features necessary for current Node version
Expand Down Expand Up @@ -49,13 +60,6 @@ module.exports = function (_context: unknown, options: Record<string, any> = {})
const plugins = [
// Polyfills the runtime needed for async/await and generators
[require.resolve('@babel/plugin-transform-runtime'), runtimeOptions],
/**
* Safari 15 has a buggy implementation of class properties,
* but @babel/compat-data marks it as stable.
* Can be removed once the issue is fixed and released.
* @see https://github.com/babel/babel/issues/14289
*/
[require.resolve('@babel/plugin-transform-class-properties')],
isEnvProduction && [
require.resolve('babel-plugin-transform-react-remove-prop-types'),
{
Expand Down

0 comments on commit 7e4cb1b

Please sign in to comment.