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

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.

主站蜘蛛池模板: 瑞金市| 溧水县| 团风县| 海口市| 广饶县| 房山区| 浠水县| 罗山县| 高碑店市| 苗栗县| 临安市| 蓝山县| 金塔县| 临汾市| 宁津县| 甘洛县| 吉水县| 遵义市| 灵山县| 墨玉县| 哈巴河县| 玉环县| 苏州市| 肃宁县| 平顺县| 盈江县| 独山县| 南宁市| 武冈市| 邹城市| 宁德市| 鸡西市| 太谷县| 新龙县| 神农架林区| 寿光市| 新源县| 沽源县| 会东县| 屏边| 师宗县|