Webpack4 dynamic import cannot get chunkname

webpack.base.config.js:

    entry: {
        app: "./src/index.js"
    },
    output: {
        path: config.build.assetsRoot,  // "/"
        publicPath: config.dev.assetsPublicPath,    // "static"
        filename: "[name].bundle.js",
        chunkFilename: "[name].chunk.js"
    },

router (you can get name): correctly by using require.ensure

const routes = [
  {
    path: "/",
    component: r => {
      require.ensure([], () => r(require("./view/index/index.vue")), "index")
    }
  },
  {
    path: "/errorPage",
    component: r => {
      require.ensure([], () => r(require("./view/errorPage/errorPage.vue")), "errorPage")
    }
  },
  {
    path: "/page",
    component: r => {
      require.ensure([], () => r(require("./view/page/page.vue")), "page")
    }
  }
];

result (get name): correctly

clipboard.png

import:


name:

clipboard.png

some people say it has something to do with the babel setting, but it doesn"t work if I try:
.babelrc:

{
    "env": {
        "production": {
            "presets": [
                ["env", {
                    "targets": {
                        "browsers": ["last 2 version", "ie 10"]
                    },
                    "modules": false,
                    "debug": true
                }]
            ],
            "plugins": [
                "transform-runtime",
                "transform-object-rest-spread",
                "dynamic-import-webpack"
            ]
        },
        "development": {
            "presets": [
                ["env", {
                    "targets": {
                        "chrome": 60
                    },
                    "modules": false,
                    "debug": true
                }]
            ],
            "plugins": [
                "transform-object-rest-spread",
                "dynamic-import-webpack"
            ]
        }
    }
}

solve the problem with all the bigwigs

Mar.07,2021
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-1bf870b-320f1.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-1bf870b-320f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?