
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
babel-plugin-dynamic-import-webpack
Advanced tools
Babel plugin to transpile import() to require.ensure, for Webpack
Babel plugin to transpile import()
to require.ensure
, for Webpack.
Note that Webpack 2 has gotten import()
after this code was written.
NOTE: Babylon v6.12.0 is required to correctly parse dynamic imports.
$ npm install babel-plugin-dynamic-import-webpack --save-dev
.babelrc
(Recommended).babelrc
{
"plugins": ["dynamic-import-webpack"]
}
$ babel --plugins dynamic-import-webpack script.js
require("babel-core").transform("code", {
plugins: ["dynamic-import-webpack"]
});
Although the specification for import()
supports a dynamic importing of modules in the browser runtime, webpack's require.ensure()
is not dynamic and requires a hardcoded string to work correctly. For more information see webpack's documentation on dynamic requires.
v1.1.0
FAQs
Babel plugin to transpile import() to require.ensure, for Webpack
The npm package babel-plugin-dynamic-import-webpack receives a total of 16,979 weekly downloads. As such, babel-plugin-dynamic-import-webpack popularity was classified as popular.
We found that babel-plugin-dynamic-import-webpack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.