Skip to content

Commit 4aec72a

Browse files
chore: use babel loose mode when transpiling classes
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
1 parent dd52844 commit 4aec72a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

support/rollup.config.umd.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,15 @@ module.exports = {
3737
babel({
3838
babelHelpers: "bundled",
3939
presets: [["@babel/env"]],
40-
plugins: ["@babel/plugin-transform-object-assign"],
40+
plugins: [
41+
"@babel/plugin-transform-object-assign",
42+
[
43+
"@babel/plugin-transform-classes",
44+
{
45+
loose: true,
46+
},
47+
],
48+
],
4149
}),
4250
],
4351
};

0 commit comments

Comments
 (0)