diff --git a/server/build/webpack.js b/server/build/webpack.js index 0ae5e14b..7a87be8b 100644 --- a/server/build/webpack.js +++ b/server/build/webpack.js @@ -74,18 +74,7 @@ export default async function createCompiler (dir, { hotReload = false, dev = fa const babelRuntimePath = require.resolve('babel-runtime/package') .replace(/[\\/]package\.json$/, '') - const loaders = [{ - test: /\.js$/, - loader: 'emit-file-loader', - include: [dir, nextPagesDir], - exclude (str) { - return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0 - }, - query: { - name: 'dist/[path][name].[ext]' - } - }] - .concat(hotReload ? [{ + const loaders = (hotReload ? [{ test: /\.js$/, loader: 'hot-self-accept-loader', include: [ @@ -94,6 +83,19 @@ export default async function createCompiler (dir, { hotReload = false, dev = fa ] }] : []) .concat([{ + test: /\.json$/, + loader: 'json-loader' + }, { + test: /\.(js|json)$/, + loader: 'emit-file-loader', + include: [dir, nextPagesDir], + exclude (str) { + return /node_modules/.test(str) && str.indexOf(nextPagesDir) !== 0 + }, + query: { + name: 'dist/[path][name].[ext]' + } + }, { loader: 'babel', include: nextPagesDir, query: { @@ -180,9 +182,6 @@ export default async function createCompiler (dir, { hotReload = false, dev = fa }, plugins, module: { - preLoaders: [ - { test: /\.json$/, loader: 'json-loader' } - ], loaders }, customInterpolateName: function (url, name, opts) {