long-term-cache-webpack-plugin
v0.1.2
Published
Yet another webpack long-term-caching plugin
Downloads
5
Maintainers
Readme
Webpack long term cache plugin
Install dependences, run npm run dev
to checkout what happened in /example
@reference: https://webpack.github.io/docs/long-term-caching.html
Install
npm i --save-dev long-term-cache-webpack-plugin
or yarn add long-term-cache-webpack-plugin
How to use
const LongTermCachePlugin = require('long-term-cache-webpack-plugin');
module.exports = {
plugins: [
new ExtractTextPlugin({
filename: '[name].[chunkhash].css',
disable: false,
allChunks: true,
}),
new LongTermCachePlugin({
// required
srcPath: '/src',
// distPath is required for watch
distPath: '/dist',
// appHtmlSrcPath: '/src/index.html',
// appHtmlDstPath: '/dist/index.html'
replaceRules: [
{
reg: /\{ASSET_BASE_PATH\}/gi,
substitute: '',
},
]
}),
],
}