From edb18dd3d65b8fbc342bde9e805c5e3293ab6e37 Mon Sep 17 00:00:00 2001 From: mitchellhamilton Date: Thu, 3 Oct 2019 17:45:20 +1000 Subject: [PATCH] Enable Babel loose mode to improve bundle size It's super safe, I use it on Emotion and things. The savings are about 900 bytes. --- .changeset/spicy-ads-poke.md | 5 +++++ babel.config.js | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changeset/spicy-ads-poke.md diff --git a/.changeset/spicy-ads-poke.md b/.changeset/spicy-ads-poke.md new file mode 100644 index 0000000000..8e99e82e3e --- /dev/null +++ b/.changeset/spicy-ads-poke.md @@ -0,0 +1,5 @@ +--- +'react-select': patch +--- + +Enable Babel loose mode to improve bundle size diff --git a/babel.config.js b/babel.config.js index e94f98cfc8..af7941a6f4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,11 @@ module.exports = { - plugins: ['emotion', '@babel/plugin-proposal-class-properties'], - presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-flow'], + plugins: [ + 'emotion', + ['@babel/plugin-proposal-class-properties', { loose: true }], + ], + presets: [ + ['@babel/preset-env', { loose: true }], + '@babel/preset-react', + '@babel/preset-flow', + ], };