You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
webpack.config.js uses the output.clean option to clean the output directory before building. When using the webpack command, it works. When using the webpack serve command with devServer.devMiddleware.writeToDisk, it does not work.
There are two scripts in package.json, build and serve. Both scripts add a file named delete-me to the dist directory before running webpack. build runs webpack while serve runs webpack serve. Both scripts should delete the delete-me file.
Actual Behavior
npm run build deletes the delete-me file as expected. However, npm run serve does not.
The text was updated successfully, but these errors were encountered:
jordanbtucker
changed the title
Honor webpack's output.clean option with devMiddlware.writeToDisk
Honor webpack's output.clean option with devMiddleware.writeToDiskJul 30, 2021
Actually, this is probably a bug in webpack-dev-middleware, and it looks like there is already an issue open for that. webpack/webpack-dev-middleware#861
Code
Please paste the results of
webpack-cli info
here, and mention other relevant informationExpected Behavior
webpack.config.js
uses theoutput.clean
option to clean the output directory before building. When using thewebpack
command, it works. When using thewebpack serve
command withdevServer.devMiddleware.writeToDisk
, it does not work.There are two scripts in
package.json
,build
andserve
. Both scripts add a file nameddelete-me
to thedist
directory before running webpack.build
runswebpack
whileserve
runswebpack serve
. Both scripts should delete thedelete-me
file.Actual Behavior
npm run build
deletes thedelete-me
file as expected. However,npm run serve
does not.For Bugs; How can we reproduce the behavior?
Please see https://github.com/jordanbtucker/webpack-dev-server-clean-issue for a minimal reproducible example, including reproduction steps.
The text was updated successfully, but these errors were encountered: