Skip to content

wanglam/dll-link-webpack-plugin

 
 

Repository files navigation

Dll Link Plugin

A webpack plugin that simplifies creation of webpack DLL file. It is based on DllReferencePlugin. And you can see the difference here.

中文 README

Install

$ yarn add dll-link-webpack-plugin -D

By now, this plugin uses yarn.lock to track dependency. So make sure you are using yarn.

Basic Usage

Replace DllReferencePlugin with DllLinkPlugin in your webpack.config.js

var DllLinkPlugin = require('dll-link-webpack-plugin');

module.exports = {
    // ...
    plugins: [
        new DllLinkPlugin({
            config: require('webpack.dll.config.js')
        })
    ]
}

And directly run

$ webpack --config webpack.config.js

This will automatically generate the DLL file. For more usage, see examples.

Configuration

  • htmlMode: true | false This is useful when you are using html-webpack-plugin. The DLL file will be included in the output html file.
  • assetsMode: true | false Emit the DLL file as webpack assets file.
  • appendVersion: true | false Append a DLL hash version to your webpack entry filenames.

Example for above options:

module.exports = {
    // ...
    plugins: [
        new DllLinkPlugin({
            config: require('webpack.dll.config.js'),
            appendVersion: true,
            assetsMode: true,
            htmlMode: true
        })
    ]
}

About

A webpack plugin aims to replace DllReferencePlugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.4%
  • Makefile 0.6%