nickjj / manifest-revision-webpack-plugin

Write out a manifest file containing your versioned webpack chunks and assets.
ISC License
124 stars 40 forks source link

Support for multiple targets #29

Open ukch opened 7 years ago

ukch commented 7 years ago

The Webpack docs describes a way to specify multiple targets by making module.exports a list. I would like to use Webpack to generate JS files and asset files, and need quite a different config for each. Here's a snippet of my config:

module.exports = [
{
    entry: {js entries here},
    output: {
        path: BASE_PATH,
        filename: "js/[name].[hash].js",
    },
},
{
    entry: {
        // This file contains includes for all my asset files. I am not interested in the
        //  final JS file, rather the generated asset files.
        assets: "./webpack-entries/assets.js",
    },
    output: {
        path: BASE_PATH,
        filename: "entries/[name].js",
    },
    module: {
        loaders: [CSS and image loaders defined here],
    },
},
];

I would like to use manifest-revision-webpack-plugin to generate a manifest containing both my asset and JS files, but I can't see a way to do that. AFAICT the only way to do that is to define it in the (target-specific) 'plugins' section, which would overwrite itself for each target (in this case leaving me with only the assets in the manifest, not the JS).