-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`.cache/` should be git ignored in projects. disabled by default. Can be enabled using `options.build.dll: true`
- Loading branch information
Pooya Parsa
committed
Aug 21, 2017
1 parent
d1a6b2b
commit d7fbe47
Showing
7 changed files
with
134 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import webpack from 'webpack' | ||
import { resolve } from 'path' | ||
import ClientConfig from './client.config' | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Webpack Dll Config | ||
| https://github.com/webpack/webpack/tree/master/examples/dll | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
export default function webpackDllConfig (_refConfig) { | ||
const refConfig = _refConfig || new ClientConfig() | ||
|
||
const name = refConfig.name + '-dll' | ||
const dllDir = resolve(this.options.cacheDir, name) | ||
|
||
let config = { | ||
name, | ||
entry: this.vendorEntries(), | ||
// context: this.options.rootDir, | ||
resolve: refConfig.resolve, | ||
target: refConfig.target, | ||
resolveLoader: refConfig.resolveLoader, | ||
module: refConfig.module, | ||
plugins: [] | ||
} | ||
|
||
config.output = { | ||
path: dllDir, | ||
filename: '[name]_[hash].js', | ||
library: '[name]_[hash]' | ||
} | ||
|
||
config.plugins.push( | ||
new webpack.DllPlugin({ | ||
// The path to the manifest file which maps between | ||
// modules included in a bundle and the internal IDs | ||
// within that bundle | ||
path: resolve(dllDir, '[name]-manifest.json'), | ||
|
||
name: '[name]_[hash]' | ||
}) | ||
) | ||
|
||
return config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters