0👍
You can use vuepress-plugin-named-chunks
plugin to modify the name and path of js chunks generated by VuePress for each page…
- Install the plugin
- Change
.vuepress\config.js
module.exports = {
plugins: [
[
"named-chunks",
{
pageChunkName: function(page) {
let chunkPath = page.path.substring(1) + page.key;
// console.log(chunkPath);
return chunkPath;
}
}
]
]
};
Internally it is using webpackChunkName
“magic comment”
If your pageChunkName
returns string with not just file name but also with path, it is important to not include leading slash – guide/readme.js
will work, /guide/readme.js
will not…..
Source:stackexchange.com