soundcloud / chunk-manifest-webpack-plugin

Allows exporting a manifest that maps entry chunk names to their output files, instead of keeping the mapping inside the webpack bootstrap.
MIT License
395 stars 73 forks source link

Inline manifest option #18

Closed TuckerCowie closed 7 years ago

TuckerCowie commented 7 years ago

Similar to #15. Adds options.inlineManifest for users who implement html-webpack-plugin;

// webpack.config.js
new ChunkManifestPlugin({
    inlineManifest: true
}),

new HtmlWebpackPlugin({
    template: 'index.ejs'
}),
<!-- index.ejs -->
<body>
    <%= htmlWebpackPlugin.files.webpackManifest %>
</body>
spadgos commented 7 years ago

How does this PR compare to #15 ? Seems to be lot of similarity there

TuckerCowie commented 7 years ago

@spadgos, #15 assumes all users of this plugin will use htmlWebpackPlugin. Additionally, it assumes that they will want to inline the manifest. This change, even though the functionality is very similar, is agnostic by allowing the user to specify the configuration via the options object while still defaulting to the current implementation of not inlining.

pavel06081991 commented 7 years ago

@diurnalist, could you please review this and merge?

jouni-kantola commented 7 years ago

FYI as mentioned in PR https://github.com/soundcloud/chunk-manifest-webpack-plugin/pull/15: inline-chunk-manifest-html-webpack-plugin now uses chunk-manifest-webpack-plugin internally to extract chunks before inlining chunk manifest (default in head).

jouni-kantola commented 7 years ago

@spadgos: Why merge a PR making the plugin tightly coupled to html-webpack-plugin, when inline-chunk-manifest-html-webpack-plugin does exactly this? chunk-manifest-webpack-plugin does a fine job doing what it does.