File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ const buildDate = new Date();
3838module . exports = ( env = { } , argv = { } ) => {
3939 // environment name based on -d, -p, webpack flag
4040 const targetEnv = process . env . NODE_ENV == "production" || argv . mode == "production" ? "production" : "development" ;
41+ // Detect if running under webpack-dev-server
42+ const isDevServer = argv . $0 && argv . $0 . includes ( "webpack-dev-server" ) ;
4143
4244 let minimizations = { } ;
4345 if ( targetEnv == "production" ) {
@@ -323,6 +325,9 @@ module.exports = (env = {}, argv = {}) => {
323325 buildDependencies : {
324326 config : [ __filename ] ,
325327 } ,
328+ // Use different cache directories for dev server vs regular build
329+ // to prevent conflicts when switching between modes
330+ name : isDevServer ? "dev-server" : "build" ,
326331 } ,
327332 devServer : {
328333 client : {
You can’t perform that action at this time.
0 commit comments