From 248c919360516d8894ea27ff01e5165051a66224 Mon Sep 17 00:00:00 2001 From: Vladimir Kutepov Date: Wed, 25 Oct 2017 23:17:52 +0300 Subject: [PATCH] Use babel react optimization plugins for production instead of development closes #1448 --- package.json | 12 +++---- tools/webpack.config.js | 6 ++-- yarn.lock | 72 ++++++++++++++++++++--------------------- 3 files changed, 44 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 9b0a157fd..26f8d597a 100644 --- a/package.json +++ b/package.json @@ -27,19 +27,19 @@ "passport-facebook": "^2.1.1", "pretty-error": "^2.1.1", "prop-types": "^15.6.0", - "query-string": "^5.0.0", + "query-string": "^5.0.1", "react": "^16.0.0", "react-dom": "^16.0.0", - "sequelize": "^4.15.0", + "sequelize": "^4.17.2", "serialize-javascript": "^1.3.0", "source-map-support": "^0.5.0", "sqlite3": "^3.1.8", - "universal-router": "^4.2.1", + "universal-router": "^4.3.0", "whatwg-fetch": "^2.0.3" }, "devDependencies": { "assets-webpack-plugin": "^3.5.1", - "autoprefixer": "^7.1.5", + "autoprefixer": "^7.1.6", "babel-core": "7.0.0-beta.3", "babel-eslint": "^8.0.1", "babel-jest": "^21.2.0", @@ -63,7 +63,7 @@ "eslint-loader": "^1.9.0", "eslint-plugin-css-modules": "^2.7.5", "eslint-plugin-flowtype": "^2.39.1", - "eslint-plugin-import": "^2.7.0", + "eslint-plugin-import": "^2.8.0", "eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-prettier": "^2.3.1", "eslint-plugin-react": "^7.4.0", @@ -106,7 +106,7 @@ "stylelint": "^8.2.0", "stylelint-config-standard": "^17.0.0", "stylelint-order": "^0.7.0", - "svg-url-loader": "^2.2.0", + "svg-url-loader": "^2.2.1", "url-loader": "^0.6.2", "webpack": "^3.8.1", "webpack-bundle-analyzer": "^2.9.0", diff --git a/tools/webpack.config.js b/tools/webpack.config.js index 291726a83..87c091209 100644 --- a/tools/webpack.config.js +++ b/tools/webpack.config.js @@ -106,13 +106,13 @@ const config = { plugins: [ // Treat React JSX elements as value types and hoist them to the highest scope // https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements - ...(isDebug ? ['transform-react-constant-elements'] : []), + ...(isDebug ? [] : ['transform-react-constant-elements']), // Replaces the React.createElement function with one that is more optimized for production // https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements - ...(isDebug ? ['transform-react-inline-elements'] : []), + ...(isDebug ? [] : ['transform-react-inline-elements']), // Remove unnecessary React propTypes from the production build // https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types - ...(isDebug ? ['transform-react-remove-prop-types'] : []), + ...(isDebug ? [] : ['transform-react-remove-prop-types']), ], }, }, diff --git a/yarn.lock b/yarn.lock index 51bddd0ae..9d02abcaf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -377,12 +377,12 @@ autoprefixer@^7.1.2: postcss "^6.0.6" postcss-value-parser "^3.2.3" -autoprefixer@^7.1.5: - version "7.1.5" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.1.5.tgz#d65d14b83c7cd1dd7bc801daa00557addf5a06b2" +autoprefixer@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.1.6.tgz#fb933039f74af74a83e71225ce78d9fd58ba84d7" dependencies: - browserslist "^2.5.0" - caniuse-lite "^1.0.30000744" + browserslist "^2.5.1" + caniuse-lite "^1.0.30000748" normalize-range "^0.1.2" num2fraction "^1.2.2" postcss "^6.0.13" @@ -2110,7 +2110,7 @@ browserslist@^2.4.0: caniuse-lite "^1.0.30000718" electron-to-chromium "^1.3.18" -browserslist@^2.5.0: +browserslist@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.5.1.tgz#68e4bc536bbcc6086d62843a2ffccea8396821c6" dependencies: @@ -2225,6 +2225,10 @@ caniuse-lite@^1.0.30000744: version "1.0.30000746" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000746.tgz#c64f95a3925cfd30207a308ed76c1ae96ea09ea0" +caniuse-lite@^1.0.30000748: + version "1.0.30000750" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000750.tgz#38ad19aa4c6d88da38e8900d3666b4e3bbb65c22" + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -3380,9 +3384,9 @@ eslint-plugin-flowtype@^2.39.1: dependencies: lodash "^4.15.0" -eslint-plugin-import@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz#21de33380b9efb55f5ef6d2e210ec0e07e7fa69f" +eslint-plugin-import@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894" dependencies: builtin-modules "^1.1.1" contains-path "^0.1.0" @@ -3822,13 +3826,7 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" -file-loader@0.11.2: - version "0.11.2" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-0.11.2.tgz#4ff1df28af38719a6098093b88c82c71d1794a34" - dependencies: - loader-utils "^1.0.2" - -file-loader@^1.1.5: +file-loader@1.1.5, file-loader@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.5.tgz#91c25b6b6fbe56dae99f10a425fd64933b5c9daa" dependencies: @@ -6580,9 +6578,9 @@ path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" -path-to-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.0.0.tgz#b77a8168c2e78bc31f3d312d71b1ace97df23870" +path-to-regexp@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.1.0.tgz#7e30f9f5b134bd6a28ffc2e3ef1e47075ac5259b" path-type@^1.0.0: version "1.1.0" @@ -7248,9 +7246,9 @@ query-string@^4.1.0: object-assign "^4.1.0" strict-uri-encode "^1.0.0" -query-string@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.0.0.tgz#fbdf7004b4d2aff792f9871981b7a2794f555947" +query-string@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.0.1.tgz#6e2b86fe0e08aef682ecbe86e85834765402bd88" dependencies: decode-uri-component "^0.2.0" object-assign "^4.1.0" @@ -7952,9 +7950,9 @@ send@0.16.1: range-parser "~1.2.0" statuses "~1.3.1" -sequelize@^4.15.0: - version "4.15.0" - resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-4.15.0.tgz#110e79f67c3a44098517fcbcf030c5ce6f89cf14" +sequelize@^4.17.2: + version "4.17.2" + resolved "https://registry.yarnpkg.com/sequelize/-/sequelize-4.17.2.tgz#c2f725087c3101f60c8caca952e6f5dbd5527bb7" dependencies: bluebird "^3.4.6" cls-bluebird "^2.0.1" @@ -7971,7 +7969,7 @@ sequelize@^4.15.0: terraformer-wkt-parser "^1.1.2" toposort-class "^1.0.1" uuid "^3.0.0" - validator "^8.0.0" + validator "^9.1.0" wkx "^0.4.1" serialize-javascript@^1.3.0: @@ -8510,11 +8508,11 @@ svg-tags@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764" -svg-url-loader@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/svg-url-loader/-/svg-url-loader-2.2.0.tgz#107e02a3e5127c23e5a0a76ba32392df39f5ad98" +svg-url-loader@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/svg-url-loader/-/svg-url-loader-2.2.1.tgz#2ad8dc8d38652e4e21d579ed3ffc3d7d4091568d" dependencies: - file-loader "0.11.2" + file-loader "1.1.5" loader-utils "1.1.0" svgo@^0.7.0: @@ -8822,11 +8820,11 @@ uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" -universal-router@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/universal-router/-/universal-router-4.2.1.tgz#128c105abad66f35b20763731b4dd6ca911c193f" +universal-router@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/universal-router/-/universal-router-4.3.0.tgz#14db92176a9f39cf6d557d6d250c0508c570b416" dependencies: - path-to-regexp "^2.0.0" + path-to-regexp "^2.1.0" universalify@^0.1.0: version "0.1.1" @@ -8912,9 +8910,9 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -validator@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-8.0.0.tgz#00d6ec230ab5d3353ab1174162a96462b947bdbd" +validator@^9.1.0: + version "9.1.1" + resolved "https://registry.yarnpkg.com/validator/-/validator-9.1.1.tgz#3bdd1065cbd28f9d96ac806dee01030d32fd97ef" value-equal@^0.4.0: version "0.4.0"