- Progressive Web Apps with React
- Scott Domes
- 120字
- 2021-07-08 09:36:20
Making an asset manifest
As the last step, we want a list of all the static assets that we’re generating. This will be useful down the line, once we start caching them to save load times. Fortunately, it’s an easy step, another plugin!
yarn add webpack-manifest-plugin and add it to webpack.config.prod.js, under plugins, with the following configuration:
var ManifestPlugin = require('webpack-manifest-plugin');
// Then, under plugins:
new ManifestPlugin({
fileName: 'asset-manifest.json',
}),
Okay, let’s try it all together. Run yarn build and then open index.html in the browser. It should look exactly the same as running yarn start. You should also see an index.html, a bundle.js, an asset-manifest.json, and an assets folder in our build folder.
推薦閱讀
- JavaScript全程指南
- Oracle 12c中文版數據庫管理、應用與開發實踐教程 (清華電腦學堂)
- Python高級編程
- C/C++常用算法手冊(第3版)
- Spring Boot Cookbook
- Android應用案例開發大全(第二版)
- Mastering Unity 2D Game Development(Second Edition)
- OpenResty完全開發指南:構建百萬級別并發的Web應用
- PHP 8從入門到精通(視頻教學版)
- OpenCV Android開發實戰
- Mastering ASP.NET Web API
- Socket.IO Cookbook
- Natural Language Processing with Python Cookbook
- Testing Practitioner Handbook
- 微軟辦公軟件認證考試MOS Access 2013實訓教程