Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
bundle-loader-janna
Advanced tools
npm i bundle-loader --save
// The chunk is requested, when you require the bundle
var waitForChunk = require("bundle-loader!./file.js");
// To wait until the chunk is available (and get the exports)
// you need to async wait for it.
waitForChunk(function(file) {
// use file like it was required with
// var file = require("./file.js");
});
// wraps the require in a require.ensure block
// Multiple callbacks can be added. They will be executed in the order of addition.
waitForChunk(callbackTwo);
waitForChunk(callbackThree);
// If a callback is added after dependencies were loaded, it will be called immediately.
The file is requested when you require the bundle loader. If you want it to request it lazy, use:
var load = require("bundle-loader?lazy!./file.js");
// The chunk is not requested until you call the load function
load(function(file) {
});
name
query parameterYou may set name for a bundle using the name
query parameter.
See documentation.
Note chunks created by the loader will be named according to the
output.chunkFilename
rule, which defaults to [id].[name]
.
Here [name]
corresponds to the chunk name set in the name
query parameter.
require("bundle-loader?lazy&name=my-chunk!./file.js");
require("bundle-loader?lazy&name=[name]!./file.js");
And the webpack configuration:
module.exports = {
entry: { ... },
output : {
path : ...,
filename : '[name].js',
chunkFilename : '[name]-[id].js', // or whatever other format you want.
},
}
Normal chunks will show up using the filename
rule above, and be named according to their chunkname.
Chunks from bundle-loader
, however will load using the chunkFilename
rule, so the example files will produce my-chunk-1.js
and file-2.js
respectively.
You can also use chunkFilename
to add hash values to the filename, since putting [hash]
in the bundle query parameter does not work correctly.
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |
FAQs
bundle loader module for webpack
The npm package bundle-loader-janna receives a total of 0 weekly downloads. As such, bundle-loader-janna popularity was classified as not popular.
We found that bundle-loader-janna demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.