Vue-cli upgrade to webpack4.6 error

webpack was also upgraded to version 4.6 during the vue-cli global upgrade package, and then the build project reported the following error,
webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.

Baidu checked, and it is said that because webpack4.0 began to abandon CommonsChunkPlugin, it is necessary to change the new webpack.optimize.CommonsChunkPlugin in webpack.config.js to splitChunks.
because I have a vue-cli project, I can"t find the file webpack.config.js.

then I found new webpack.optimize.CommonsChunkPlugin in webpack.prod.conf.js and changed it to splitChunks. SplitChunks is not defined will be reported when build.

how should this situation be solved?

May.07,2021

the following is what I use to test webpack@4.x tests locally, I run oK, locally, and you'd better show the configuration and project structure of webpack, so as to help deal with problems more conveniently.

   
my local modification of the test function OK, does split the code

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35f24-40560.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35f24-40560.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?