From a7bc644652bcb5799d54ea3c3fe3dfad6ef59782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Daniel=20Xalambr=C3=AD?= Date: Sun, 13 Nov 2016 21:23:16 -0500 Subject: [PATCH] =?UTF-8?q?Optimizar=20build=20y=20React=20para=20producci?= =?UTF-8?q?=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 ++++++ webpack/webpack.client.config.js | 11 ++++++++++- webpack/webpack.server.config.js | 13 +++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2a5dc6d..16d0dca 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,13 @@ "babel-loader": "6.2.7", "babel-plugin-transform-es2015-modules-commonjs": "6.18.0", "babel-plugin-transform-es2015-template-literals": "6.8.0", + "babel-plugin-transform-minify-booleans": "6.8.0", + "babel-plugin-transform-react-constant-elements": "6.9.1", + "babel-plugin-transform-react-inline-elements": "6.8.0", + "babel-plugin-transform-remove-console": "6.8.0", + "babel-plugin-transform-remove-debugger": "6.8.0", "babel-plugin-transform-runtime": "6.15.0", + "babel-plugin-transform-undefined-to-void": "6.8.0", "babel-preset-es2015": "6.18.0", "babel-preset-es2016": "6.16.0", "babel-preset-es2017": "6.16.0", diff --git a/webpack/webpack.client.config.js b/webpack/webpack.client.config.js index 6d7fe82..fd6f7cf 100644 --- a/webpack/webpack.client.config.js +++ b/webpack/webpack.client.config.js @@ -32,7 +32,16 @@ const config = { presets: ['es2016', 'es2017', 'react'], env: { production: { - plugins: ['transform-regenerator', 'transform-runtime'], + plugins: [ + 'transform-regenerator', + 'transform-runtime', + 'transform-react-constant-elements', + 'transform-react-inline-elements', + 'transform-minify-booleans', + 'transform-remove-console', + 'transform-remove-debugger', + 'transform-undefined-to-void', + ], presets: ['es2015'], }, development: { diff --git a/webpack/webpack.server.config.js b/webpack/webpack.server.config.js index 066ad89..ff6c78c 100644 --- a/webpack/webpack.server.config.js +++ b/webpack/webpack.server.config.js @@ -40,10 +40,19 @@ const config = { loader: 'babel', exclude: /(node_modules)/, query: { - presets: ['latest-minimal', 'react'], + presets: ['react'], env: { production: { - plugins: ['transform-regenerator', 'transform-runtime'], + plugins: [ + 'transform-regenerator', + 'transform-runtime', + 'transform-react-constant-elements', + 'transform-react-inline-elements', + 'transform-minify-booleans', + 'transform-remove-console', + 'transform-remove-debugger', + 'transform-undefined-to-void', + ], presets: ['es2015'], }, development: {