0.1.2 • Published 7 years ago

long-term-cache-webpack-plugin v0.1.2

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

npm node Build Status

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: '',
        },
      ]
    }),
  ],
}
0.1.2

7 years ago

0.1.1

7 years ago

1.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.1.0

7 years ago