New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

chunks-extract-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chunks-extract-plugin

extract chunkMap to json file, and read it.

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

chunks-extract-plugin

extract chunkMap to json file, and read it.

Version

webpackchunks-extract-plugin
5.x2.x
4.x1.x

Before

javascript file

var url = __webpack_require__.p + __webpack_require__.u(chunkId);

After

javascript file

let fetchSrc
new Promise(function(resolve, reject) {
fetch(__webpack_require__.p + 'routes.json')
.then(response => response.json())
.then(response => {
    fetchSrc = __webpack_require__.p + response[chunkId] + ".chunk.js";
    return resolve();
})
.catch(() => resolve());
}).then(function(){
    var url = fetchSrc;
    // code
});

json file

{"0":"0-2b10c240", "1":"0-2b10c240"}

License

MIT Licensed Copyright (c) 2023 Iftek

Keywords

chunks

FAQs

Package last updated on 10 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts