From 6d9631374825c64a31d760279e27c31a8c738891 Mon Sep 17 00:00:00 2001 From: Chad Fawcett Date: Tue, 23 Oct 2018 16:01:53 -0700 Subject: [PATCH 1/2] Add mini-css-extract-plugin to app/react dependencies --- app/react/package.json | 1 + yarn.lock | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/react/package.json b/app/react/package.json index 1a1238258949..512ba1a97a13 100644 --- a/app/react/package.json +++ b/app/react/package.json @@ -38,6 +38,7 @@ "common-tags": "^1.8.0", "global": "^4.3.2", "lodash": "^4.17.11", + "mini-css-extract-plugin": "^0.4.4", "prop-types": "^15.6.2", "react-dev-utils": "^6.0.5", "semver": "^5.6.0", diff --git a/yarn.lock b/yarn.lock index 923ea2e6b4b0..f94336545df8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14951,7 +14951,7 @@ mini-css-extract-plugin@0.4.3: schema-utils "^1.0.0" webpack-sources "^1.1.0" -mini-css-extract-plugin@~0.4.0: +mini-css-extract-plugin@^0.4.4, mini-css-extract-plugin@~0.4.0: version "0.4.4" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.4.tgz#c10410a004951bd3cedac1da69053940fccb625d" integrity sha512-o+Jm+ocb0asEngdM6FsZWtZsRzA8koFUudIDwYUfl94M3PejPHG7Vopw5hN9V8WsMkSFpm3tZP3Fesz89EyrfQ== From ab85679b9aaf3d5076523bb109ac6d9a0fe8011d Mon Sep 17 00:00:00 2001 From: Chad Fawcett Date: Tue, 23 Oct 2018 16:11:28 -0700 Subject: [PATCH 2/2] Update import --- app/react/src/server/cra_config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/react/src/server/cra_config.js b/app/react/src/server/cra_config.js index 07a38175cccf..4a8cdda3339e 100644 --- a/app/react/src/server/cra_config.js +++ b/app/react/src/server/cra_config.js @@ -1,4 +1,6 @@ import semver from 'semver'; +import MiniCssExtractPlugin from 'mini-css-extract-plugin'; + import { normalizeCondition } from 'webpack/lib/RuleSet'; export function isReactScriptsInstalled() { @@ -62,8 +64,6 @@ export function applyCRAWebpackConfig(baseConfig) { // Add css minification for production const plugins = [...baseConfig.plugins]; if (baseConfig.mode === 'production') { - // eslint-disable-next-line global-require, import/no-extraneous-dependencies - const MiniCssExtractPlugin = require('mini-css-extract-plugin'); plugins.push( new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output