Skip to content
This repository was archived by the owner on Jun 3, 2019. It is now read-only.

Commit 835de07

Browse files
committed
Webpack 4 and HMR 4 working
1 parent 83d533a commit 835de07

4 files changed

Lines changed: 1962 additions & 531 deletions

File tree

File renamed without changes.

internal/webpack/configFactory.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import ExtractTextPlugin from 'extract-text-webpack-plugin';
44
import nodeExternals from 'webpack-node-externals';
55
import path from 'path';
66
import webpack from 'webpack';
7-
import WebpackMd5Hash from 'webpack-md5-hash';
87

98
import { happyPackPlugin, log } from '../utils';
109
import { ifElse } from '../../shared/utils/logic';
@@ -64,6 +63,8 @@ export default function webpackConfigFactory(buildOptions) {
6463
}
6564

6665
let webpackConfig = {
66+
// Webpack Mode
67+
mode: ifDev('development', 'production'),
6768
// Define our entry chunks for our bundle.
6869
entry: {
6970
// We name our entry files "index" as it makes it easier for us to
@@ -176,7 +177,7 @@ export default function webpackConfigFactory(buildOptions) {
176177
// This is required for the modernizr-loader
177178
// @see https://github.com/peerigon/modernizr-loader
178179
alias: {
179-
modernizr$: path.resolve(appRootDir.get(), './.modernizrrc'),
180+
modernizr$: path.resolve(appRootDir.get(), './.modernizrrc.json'),
180181
},
181182
},
182183

@@ -226,13 +227,6 @@ export default function webpackConfigFactory(buildOptions) {
226227
// the significant improvement will be how fast the JavaScript loads in the browser.
227228
ifProdClient(new webpack.optimize.ModuleConcatenationPlugin()),
228229

229-
// We use this so that our generated [chunkhash]'s are only different if
230-
// the content for our respective chunks have changed. This optimises
231-
// our long term browser caching strategy for our client bundle, avoiding
232-
// cases where browsers end up having to download all the client chunks
233-
// even though 1 or 2 may have only changed.
234-
ifClient(() => new WebpackMd5Hash()),
235-
236230
// These are process.env flags that you can use in your code in order to
237231
// have advanced control over what is included/excluded in your bundles.
238232
// For example you may only want certain parts of your code to be
@@ -500,10 +494,6 @@ export default function webpackConfigFactory(buildOptions) {
500494
test: /\.modernizrrc.js$/,
501495
loader: 'modernizr-loader',
502496
}),
503-
ifClient({
504-
test: /\.modernizrrc(\.json)?$/,
505-
loader: 'modernizr-loader!json-loader',
506-
}),
507497

508498
// ASSETS (Images/Fonts/etc)
509499
// This is bound to our server/client bundles as we only expect to be

0 commit comments

Comments
 (0)