Switch to preset-env for babel (#476)

This commit is contained in:
Paulus Schoutsen 2024-02-13 12:00:45 -05:00 committed by GitHub
parent a69aa84df6
commit df7b4c69e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2878 additions and 452 deletions

3314
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,7 @@
"prepublishOnly": "script/build"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-logical-assignment-operators": "^7.23.4",
"@babel/preset-env": "^7.23.9",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",

View File

@ -20,9 +20,16 @@ const config = {
}),
babel({
babelHelpers: "bundled",
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-logical-assignment-operators",
presets: [
[
"@babel/preset-env",
{
targets: {
// We use unpkg as CDN and it doesn't bundle modern syntax
chrome: "84",
},
},
],
],
}),
json(),