1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Remove WriteFilePlugin (#5541)

It is native by webpack-dev-middleware 3.1.0 up
This commit is contained in:
Radovan Šmitala 2018-11-02 19:47:56 +01:00 committed by Tim Neutkens
parent ad84d23a02
commit bf157015fb
4 changed files with 3 additions and 42 deletions

View file

@ -4,7 +4,6 @@ import path from 'path'
import webpack from 'webpack' import webpack from 'webpack'
import resolve from 'resolve' import resolve from 'resolve'
import CaseSensitivePathPlugin from 'case-sensitive-paths-webpack-plugin' import CaseSensitivePathPlugin from 'case-sensitive-paths-webpack-plugin'
import WriteFilePlugin from 'write-file-webpack-plugin'
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
import WebpackBar from 'webpackbar' import WebpackBar from 'webpackbar'
import {getPages} from './webpack/utils' import {getPages} from './webpack/utils'
@ -264,12 +263,6 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
dev && new webpack.NoEmitOnErrorsPlugin(), dev && new webpack.NoEmitOnErrorsPlugin(),
dev && new UnlinkFilePlugin(), dev && new UnlinkFilePlugin(),
dev && new CaseSensitivePathPlugin(), // Since on macOS the filesystem is case-insensitive this will make sure your path are case-sensitive dev && new CaseSensitivePathPlugin(), // Since on macOS the filesystem is case-insensitive this will make sure your path are case-sensitive
dev && new WriteFilePlugin({
exitOnErrors: false,
log: false,
// required not to cache removed files
useHashIndex: false
}),
// Removes server/client code by minifier // Removes server/client code by minifier
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.browser': JSON.stringify(!isServer) 'process.browser': JSON.stringify(!isServer)

View file

@ -1,32 +0,0 @@
// flow-typed signature: 4a61661df41490b27db4f4aa0c03929e
// flow-typed version: <<STUB>>/write-file-webpack-plugin_v4.2.0/flow_v0.73.0
/**
* This is an autogenerated libdef stub for:
*
* 'write-file-webpack-plugin'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'write-file-webpack-plugin' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'write-file-webpack-plugin/dist/index' {
declare module.exports: any;
}
// Filename aliases
declare module 'write-file-webpack-plugin/dist/index.js' {
declare module.exports: $Exports<'write-file-webpack-plugin/dist/index'>;
}

View file

@ -89,8 +89,7 @@
"webpack-dev-middleware": "3.4.0", "webpack-dev-middleware": "3.4.0",
"webpack-hot-middleware": "2.22.3", "webpack-hot-middleware": "2.22.3",
"webpack-sources": "1.2.0", "webpack-sources": "1.2.0",
"webpackbar": "2.6.3", "webpackbar": "2.6.3"
"write-file-webpack-plugin": "4.3.2"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^16.0.0", "react": "^16.0.0",

View file

@ -320,7 +320,8 @@ export default class HotReloader {
publicPath: `/_next/static/webpack`, publicPath: `/_next/static/webpack`,
noInfo: true, noInfo: true,
logLevel: 'silent', logLevel: 'silent',
watchOptions: { ignored } watchOptions: { ignored },
writeToDisk: true
} }
if (this.config.webpackDevMiddleware) { if (this.config.webpackDevMiddleware) {