Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

webpack-dll-loader

0.0.1 • Public • Published

webpac-dll-loader

针对于webpack DLLPlugin生成的script脚本映入到相应的html中

使用方法

npm install webpac-dll-loader --save-dev

编译 webpack.product.config.js 配置新增loader配置 例如:


config.module.rules = (config.module.rules || []).concat([{
    test: path.resolve(__dirname, '../src/index.html'),
    loader: 'webpack-dll-loader',
    exclude: "/node_modules/",
    options:{
        publicPath:'/libs/',
        manifest:path.resolve(__dirname, '../dist/production/libs/vendor-manifest.json')
    }
}])

参数说明

  • publicPath :webpack DLLPlugin编译后存放的目录
  • manifest :webpack DLLPlugin编译后生成的manifest.json文件位置

备注: webpack.dll.config.js 配置的 output.filename , output.library 和 new webpack.DllPlugin 配置的 name 参数保持一致 例如:[name]_[hash]

Install

npm i webpack-dll-loader

DownloadsWeekly Downloads

4

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar