
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
dll-factory
Advanced tools
Wrapper over DllReferencePlugin which make possible bundling vendor packages
Webpack DllPlugin manifest file keeps files list (exactly files, not dirs) resolved using .main (and other similar) properties of package.json of bundled packages. You can't import directory from dll, it must be a file:
// Import from dll without dll-factory
// react.js is the value taken from "main" proprety of react/package.json
import React from 'react/react.js';
// Import from dll with dll-factory applied
// "main" property of react/package.json is resolved
import React from 'react';
Wrapper over DllReferencePlugin which make possible import of bundled vendor packages. It takes manifest file content and changes it so that it then maps ./<module name> which is used in app imports into manifesto entry. Originally manifest file contains exact files, which is not suitable for importing packages from bundle.
Originally created manifest:
{
"name": "vendor_fb20ea5237d914031248",
"content": {
"./react/react.js": {
"id": 0,
"meta": {}
}
}
}
will be translated into:
{
"name": "vendor_fb20ea5237d914031248",
"content": {
"./react": {
"id": 0,
"meta": {}
}
}
}
Put this code into .plugins section of webpack config file:
require('dll-factory').dllFactory({
// Parsed JSON for app's package.json
appPackage: require('package.json'),
// relative path to dir with dll. Default is ./dll
dllPath: './path-to-dll-dir',
// In case your app imports files from packages not from package.json:main entry point
// list these files in .extraImports.
// Optional param.
extraImports: [
'./react-redux-form/lib/utils/update-field'
],
// Scope to append import. Example below will lead to "import react from 'dll/react';"
scope: 'dll',
}),
FAQs
Wrapper over DllReferencePlugin which make possible bundling vendor packages
We found that dll-factory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.