Problems in webpack4.x configuration

directory structure

webpack.config.js

index.js


dist



webpack,dist

< hr > < hr > < H2 > question: < / H2 >

1. After optimization.cacheGroups is added, chunkFilename in the mini-css-extract-plugin configuration replaces filename,. Does cacheGroups cause css to become an asynchronously loaded module?
2. Why a new style.js? is generated Because index.js refers to css?. And went to the folder async of the asynchronous module.

what is the principle of the ball solution? I feel that webpack4 is more difficult to use than 3

Sep.23,2021

cacheGroups.styles.test should be changed to /\ .css $/ . In this way, it will not be overwritten, and styles.js will not generate


.
optimization: {
  splitChunks: {
    cacheGroups: {
      vendor: {
        test: /[\\/]node_modules[\\/].*\.js$/,
        name: 'vendors',
        chunks: 'all',
      },
    },
  },
},

just write it this way.

found in mini-css-extract-plugin github issues.
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-1eb5c40-257d.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-1eb5c40-257d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?