Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

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

7

version

0.0.1

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability