Skip to content

Commit

Permalink
back to preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Dec 27, 2023
1 parent 6a88b91 commit e6416a8
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 59 deletions.
11 changes: 10 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
module.exports = {
presets: [
['@babel/preset-modules', { loose: true }],
[
'@babel/preset-env',
{
bugfixes: true,
targets: {
browsers: 'defaults',
node: 'current',
},
},
],
'@babel/preset-typescript',
],
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"dependencies": {
"@babel/core": "^7.20.7",
"@babel/preset-env": "^7.20.2",
"@babel/preset-modules": "^0.1.6",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@changesets/changelog-github": "^0.4.8",
Expand Down
50 changes: 16 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion site/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{ bugfixes: true, targets: 'last 2 Chrome versions' },
],
'@babel/preset-typescript',
['@babel/preset-react', { runtime: 'automatic' }],
['@babel/preset-env', { targets: { node: 14 } }],
],
};
24 changes: 4 additions & 20 deletions site/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = [
},
mode,
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
extensions: ['.ts', '.tsx', '.js', '.json'],
},
module: {
rules: [
Expand All @@ -55,15 +55,7 @@ module.exports = [
{
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{ modules: false, targets: 'last 2 Chrome versions' },
],
['@babel/preset-react', { runtime: 'automatic' }],
],
babelrc: true,
},
},
],
Expand Down Expand Up @@ -122,7 +114,7 @@ module.exports = [
entry: require.resolve('./src/render.tsx'),
mode,
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
extensions: ['.ts', '.tsx', '.js', '.json'],
},
module: {
rules: [
Expand All @@ -132,15 +124,7 @@ module.exports = [
{
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{ modules: false, targets: 'last 2 Chrome versions' },
],
['@babel/preset-react', { runtime: 'automatic' }],
],
babelrc: true,
},
},
],
Expand Down
10 changes: 8 additions & 2 deletions test-helpers/src/startFixture/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ export const startWebpackFixture = (
options: {
babelrc: false,
presets: [
[require.resolve('@babel/preset-modules'), { loose: true }],
[
require.resolve('@babel/preset-env'),
{ bugfixes: true, targets: { esmodules: true } },
],
require.resolve('@babel/preset-typescript'),
require.resolve('@babel/preset-react'),
[
require.resolve('@babel/preset-react'),
{ runtime: 'automatic' },
],
],
},
},
Expand Down

0 comments on commit e6416a8

Please sign in to comment.