Skip to content

Commit

Permalink
chore: use babel loose mode when transpiling classes
Browse files Browse the repository at this point in the history
By default, Babel uses `Object.defineProperty()` when transpiling
classes. We'll now use the loose mode which creates a more terse
output.

|          | before | after  |
|----------|--------|--------|
| min+gzip | 8.8 KB | 8.6 KB |
| min+br   | 8.0 KB | 7.7 KB |

Reference: https://babeljs.io/docs/babel-plugin-transform-classes
  • Loading branch information
darrachequesne committed May 31, 2024
1 parent dd52844 commit 4aec72a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion support/rollup.config.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ module.exports = {
babel({
babelHelpers: "bundled",
presets: [["@babel/env"]],
plugins: ["@babel/plugin-transform-object-assign"],
plugins: [
"@babel/plugin-transform-object-assign",
[
"@babel/plugin-transform-classes",
{
loose: true,
},
],
],
}),
],
};

0 comments on commit 4aec72a

Please sign in to comment.