dll-factory
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 React from 'react/react.js';
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": {}
}
}
}
Usage example
Put this code into .plugins
section of webpack config file:
require('dll-factory').dllFactory({
appPackage: require('package.json'),
dllPath: './path-to-dll-dir',
extraImports: [
'./react-redux-form/lib/utils/update-field'
],
scope: 'dll',
}),