官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 灵川县| 县级市| 金山区| 都兰县| 合山市| 麻阳| 怀柔区| 南召县| 惠来县| 怀宁县| 嵊泗县| 阜宁县| 越西县| 齐齐哈尔市| 肥城市| 福海县| 申扎县| 保德县| 邯郸市| 张家川| 改则县| 昭觉县| 泸西县| 鲁甸县| 隆德县| 南昌县| 磐安县| 江西省| 大理市| 清远市| 兴国县| 平昌县| 富宁县| 新泰市| 如皋市| 丰原市| 新宁县| 翁牛特旗| 宁波市| 寻乌县| 略阳县|