Unverified Commit b475e619 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Implement hard-source-webpack-plugin (#5181)

Follow-up of #5176

Closes #5173 as it led to inconsistencies in DX.
parent 459c1c13
...@@ -20,6 +20,7 @@ import { ReactLoadablePlugin } from './webpack/plugins/react-loadable-plugin' ...@@ -20,6 +20,7 @@ import { ReactLoadablePlugin } from './webpack/plugins/react-loadable-plugin'
import {SERVER_DIRECTORY, NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT_NODE_MODULES, NEXT_PROJECT_ROOT_DIST, DEFAULT_PAGES_DIR, REACT_LOADABLE_MANIFEST, CLIENT_STATIC_FILES_RUNTIME_WEBPACK, CLIENT_STATIC_FILES_RUNTIME_MAIN} from '../lib/constants' import {SERVER_DIRECTORY, NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT_NODE_MODULES, NEXT_PROJECT_ROOT_DIST, DEFAULT_PAGES_DIR, REACT_LOADABLE_MANIFEST, CLIENT_STATIC_FILES_RUNTIME_WEBPACK, CLIENT_STATIC_FILES_RUNTIME_MAIN} from '../lib/constants'
import AutoDllPlugin from 'autodll-webpack-plugin' import AutoDllPlugin from 'autodll-webpack-plugin'
import TerserPlugin from 'terser-webpack-plugin' import TerserPlugin from 'terser-webpack-plugin'
import HardSourceWebpackPlugin from 'hard-source-webpack-plugin'
// The externals config makes sure that // The externals config makes sure that
// on the server side when modules are // on the server side when modules are
...@@ -235,6 +236,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i ...@@ -235,6 +236,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
resolve: resolveConfig resolve: resolveConfig
} }
}), }),
new HardSourceWebpackPlugin(),
// This plugin makes sure `output.filename` is used for entry chunks // This plugin makes sure `output.filename` is used for entry chunks
new ChunkNamesPlugin(), new ChunkNamesPlugin(),
!isServer && new ReactLoadablePlugin({ !isServer && new ReactLoadablePlugin({
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
"fresh": "0.5.2", "fresh": "0.5.2",
"friendly-errors-webpack-plugin": "1.7.0", "friendly-errors-webpack-plugin": "1.7.0",
"glob": "7.1.2", "glob": "7.1.2",
"hard-source-webpack-plugin": "0.12.0",
"hoist-non-react-statics": "2.5.5", "hoist-non-react-statics": "2.5.5",
"htmlescape": "1.1.1", "htmlescape": "1.1.1",
"http-errors": "1.6.2", "http-errors": "1.6.2",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment