Wrapper over DllReferencePlugin which make possible bundling vendor packages
npm install dll-factory.main (and other similar) properties of package.json of bundled packages. You can't import directory from dll, it must be a file:``javascript
// 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 ./ 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:
`json
{
"name": "vendor_fb20ea5237d914031248",
"content": {
"./react/react.js": {
"id": 0,
"meta": {}
}
}
}
`
will be translated into:
`json
{
"name": "vendor_fb20ea5237d914031248",
"content": {
"./react": {
"id": 0,
"meta": {}
}
}
}
`
section of webpack config file:`javascript
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',
}),
``