gzip-loader

gzip-loader

用于 webpack 的 gzip 加载器模块

启用加载 gzip 资源。

安装

npm install --save-dev gzip-loader

用法

webpack.config.js

module.exports = { module: { rules: [ { test: /\.gz$/, enforce: 'pre', use: 'gzip-loader' } ] } }

bundle.js

require("gzip-loader!./file.js.gz"