Leecason / webpack-long-term-caching-demos

Webpack4 持久化缓存实践,10 个 demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-long-term-caching-demos

This repo is a collection of simple demos of Webpack for long-term caching.

Before you learn those demos, you need to know about Webpack.

How to use

First, install webpack and webpack-cli globally.

$ npm i -g webpack webpack-cli

Then, clone the repo.

$ git clone https://github.com/Leecason/webpack-long-term-caching-demos.git

Install dependencies.

$ cd webpack-long-term-caching-demos
$ npm install

Now, play with the source files under the repo's demo* directories.

$ cd demo01
$ npm run build

Index

  1. 简单的 hash
  2. 增加一个 vendors
  3. 使用 chunkhash
  4. 增加新模块
  5. 稳定 module id
  6. 增加 CSS 模块
  7. contenthash解决 CSS 模块修改后 JS 文件 hash 变动问题
  8. 增加异步模块
  9. 增加第二个入口文件
  10. 稳定 chunk id

License

MIT

About

Webpack4 持久化缓存实践,10 个 demo

License:MIT License


Languages

Language:JavaScript 90.5%Language:CSS 9.5%