Skip to content

Commit 7b2231e

Browse files
committed
update site webpack config for production
1 parent a4d5ca3 commit 7b2231e

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"eslint-plugin-import": "^2.18.2",
8888
"eslint-plugin-jsx-a11y": "^6.2.3",
8989
"eslint-plugin-react": "^7.16.0",
90-
"extract-text-webpack-plugin": "3.0.2",
90+
"mini-css-extract-plugin": "0.9.0",
9191
"node-sass": "^4.13.0",
9292
"prettier": "^1.13.5",
9393
"redux-logger": "^3.0.6",

webpack/site.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const ExtractTextPlugin = require('extract-text-webpack-plugin')
1+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
22
const HtmlWebpackPlugin = require('html-webpack-plugin')
33
const path = require('path')
44

@@ -25,12 +25,11 @@ module.exports = {
2525
isProd
2626
? {
2727
test: /\.scss$/,
28-
use: {
29-
loader: ExtractTextPlugin.extract({
30-
fallback: 'style-loader',
31-
use: 'css-loader!sass-loader',
32-
}),
33-
},
28+
use: [
29+
MiniCssExtractPlugin.loader,
30+
{ loader: 'css-loader', options: { sourceMap: true, importLoaders: 1 } },
31+
{ loader: 'sass-loader', options: { sourceMap: true } },
32+
],
3433
}
3534
: {
3635
test: /\.scss$/,
@@ -43,7 +42,7 @@ module.exports = {
4342
],
4443
},
4544
plugins: [
46-
...(isProd ? [new ExtractTextPlugin('styles-[hash].css')] : []),
45+
...(isProd ? [new MiniCssExtractPlugin({ filename: 'styles-[hash].css' })] : []),
4746
new HtmlWebpackPlugin({
4847
template: './site/template.html',
4948
}),

yarn.lock

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1:
11121112
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da"
11131113
integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==
11141114

1115-
ajv@^5.0.0, ajv@^5.1.0:
1115+
ajv@^5.1.0:
11161116
version "5.5.2"
11171117
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
11181118
dependencies:
@@ -1427,7 +1427,7 @@ async@^2.0.0:
14271427
dependencies:
14281428
lodash "^4.14.0"
14291429

1430-
async@^2.4.1, async@^2.6.2:
1430+
async@^2.6.2:
14311431
version "2.6.3"
14321432
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
14331433
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
@@ -3904,16 +3904,6 @@ extglob@^2.0.4:
39043904
snapdragon "^0.8.1"
39053905
to-regex "^3.0.1"
39063906

3907-
extract-text-webpack-plugin@3.0.2:
3908-
version "3.0.2"
3909-
resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.2.tgz#5f043eaa02f9750a9258b78c0a6e0dc1408fb2f7"
3910-
integrity sha512-bt/LZ4m5Rqt/Crl2HiKuAl/oqg0psx1tsTLkvWbJen1CtD+fftkZhMaQ9HOtY2gWsl2Wq+sABmMVi9z3DhKWQQ==
3911-
dependencies:
3912-
async "^2.4.1"
3913-
loader-utils "^1.1.0"
3914-
schema-utils "^0.3.0"
3915-
webpack-sources "^1.0.1"
3916-
39173907
extract-zip@^1.0.3:
39183908
version "1.6.6"
39193909
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c"
@@ -6117,6 +6107,16 @@ min-document@^2.19.0:
61176107
dependencies:
61186108
dom-walk "^0.1.0"
61196109

6110+
mini-css-extract-plugin@0.9.0:
6111+
version "0.9.0"
6112+
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
6113+
integrity sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==
6114+
dependencies:
6115+
loader-utils "^1.1.0"
6116+
normalize-url "1.9.1"
6117+
schema-utils "^1.0.0"
6118+
webpack-sources "^1.1.0"
6119+
61206120
mini-css-extract-plugin@^0.7.0:
61216121
version "0.7.0"
61226122
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.7.0.tgz#5ba8290fbb4179a43dd27cca444ba150bee743a0"
@@ -8722,13 +8722,6 @@ scheduler@^0.17.0:
87228722
loose-envify "^1.1.0"
87238723
object-assign "^4.1.1"
87248724

8725-
schema-utils@^0.3.0:
8726-
version "0.3.0"
8727-
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf"
8728-
integrity sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=
8729-
dependencies:
8730-
ajv "^5.0.0"
8731-
87328725
schema-utils@^0.4.3:
87338726
version "0.4.5"
87348727
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e"
@@ -10181,7 +10174,7 @@ webpack-merge@^4.2.1:
1018110174
dependencies:
1018210175
lodash "^4.17.15"
1018310176

10184-
webpack-sources@1.0.1, webpack-sources@^1.0.1, webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1:
10177+
webpack-sources@1.0.1, webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1:
1018510178
version "1.0.1"
1018610179
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.1.tgz#c7356436a4d13123be2e2426a05d1dad9cbe65cf"
1018710180
dependencies:

0 commit comments

Comments
 (0)