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

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.

主站蜘蛛池模板: 扶余县| 东阿县| 乌兰浩特市| 上栗县| 湟源县| 赞皇县| 溧水县| 绥中县| 汉沽区| 阳原县| 买车| 赤峰市| 将乐县| 巨野县| 崇阳县| 宜兴市| 河北省| 定日县| 伽师县| 布拖县| 连城县| 三门县| 突泉县| 齐齐哈尔市| 南通市| 图木舒克市| 深水埗区| 山丹县| 望谟县| 安义县| 岗巴县| 常熟市| 武威市| 潜山县| 平阴县| 南开区| 海安县| 浦北县| 监利县| 巩留县| 泊头市|