Skip to content

Commit

Permalink
Use @babel/preset-env to emit valid es2015
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityrail committed Aug 23, 2021
1 parent eef941a commit 9b17538
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

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

5 changes: 5 additions & 0 deletions projects/packages/lazy-images/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
["@babel/preset-env"]
]
}
5 changes: 5 additions & 0 deletions projects/packages/lazy-images/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
},
"license": "GPL-2.0-or-later",
"author": "Automattic",
"browserslist": [
"extends @wordpress/browserslist-config"
],
"scripts": {
"build": "pnpm run install-if-deps-outdated && pnpm run clean && pnpm run build-js",
"build-js": "calypso-build && cp ./node_modules/intersection-observer/intersection-observer.js ./dist/intersection-observer.src.js",
Expand All @@ -25,6 +28,8 @@
"intersection-observer": "^0.12.0"
},
"devDependencies": {
"@wordpress/browserslist-config": "4.1.0",
"babel-loader": "8.2.2",
"@automattic/calypso-build": "9.0.0",
"eslint": "7.31.0",
"webpack": "5.51.1"
Expand Down
14 changes: 14 additions & 0 deletions projects/packages/lazy-images/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,19 @@ module.exports = [
'./node_modules/intersection-observer/intersection-observer.js'
),
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [ '@babel/preset-env' ],
},
},
},
],
},
},
];

0 comments on commit 9b17538

Please sign in to comment.