From bf157015fb80a3a5d44a5399e398a59bd031ef58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20=C5=A0mitala?= Date: Fri, 2 Nov 2018 19:47:56 +0100 Subject: [PATCH] Remove WriteFilePlugin (#5541) It is native by webpack-dev-middleware 3.1.0 up --- packages/next/build/webpack.js | 7 ---- .../npm/write-file-webpack-plugin_vx.x.x.js | 32 ------------------- packages/next/package.json | 3 +- packages/next/server/hot-reloader.js | 3 +- 4 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 packages/next/flow-typed/npm/write-file-webpack-plugin_vx.x.x.js diff --git a/packages/next/build/webpack.js b/packages/next/build/webpack.js index 56ef6ace..0263cd25 100644 --- a/packages/next/build/webpack.js +++ b/packages/next/build/webpack.js @@ -4,7 +4,6 @@ import path from 'path' import webpack from 'webpack' import resolve from 'resolve' import CaseSensitivePathPlugin from 'case-sensitive-paths-webpack-plugin' -import WriteFilePlugin from 'write-file-webpack-plugin' import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' import WebpackBar from 'webpackbar' 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 UnlinkFilePlugin(), 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 new webpack.DefinePlugin({ 'process.browser': JSON.stringify(!isServer) diff --git a/packages/next/flow-typed/npm/write-file-webpack-plugin_vx.x.x.js b/packages/next/flow-typed/npm/write-file-webpack-plugin_vx.x.x.js deleted file mode 100644 index 41e64c94..00000000 --- a/packages/next/flow-typed/npm/write-file-webpack-plugin_vx.x.x.js +++ /dev/null @@ -1,32 +0,0 @@ -// flow-typed signature: 4a61661df41490b27db4f4aa0c03929e -// flow-typed version: <>/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'>; -} diff --git a/packages/next/package.json b/packages/next/package.json index d33f99e0..7b00cd61 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -89,8 +89,7 @@ "webpack-dev-middleware": "3.4.0", "webpack-hot-middleware": "2.22.3", "webpack-sources": "1.2.0", - "webpackbar": "2.6.3", - "write-file-webpack-plugin": "4.3.2" + "webpackbar": "2.6.3" }, "peerDependencies": { "react": "^16.0.0", diff --git a/packages/next/server/hot-reloader.js b/packages/next/server/hot-reloader.js index 1689187e..1f5f8340 100644 --- a/packages/next/server/hot-reloader.js +++ b/packages/next/server/hot-reloader.js @@ -320,7 +320,8 @@ export default class HotReloader { publicPath: `/_next/static/webpack`, noInfo: true, logLevel: 'silent', - watchOptions: { ignored } + watchOptions: { ignored }, + writeToDisk: true } if (this.config.webpackDevMiddleware) {