shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 185 forks source link

Not found in next Plugin after generate the json file #150

Closed TerryChenUI closed 3 years ago

TerryChenUI commented 6 years ago

I want to read the manifest.json in next plugin, but it not find, is is possible to do it ?

        new ManifestPlugin(),
        new ReplaceInFileWebpackPlugin([{
            dir: 'dist',
            test: /\.html$/,
            rules: [{
                search: /\/js\/common\.(css|js)/ig,
                replace: function (match) {
                    console.log(match);
                    console.log('test:', require('./dist/js/manifest.json')); // Not work
                    return 'test';
                }
            }]
        }])
mastilver commented 6 years ago

The manifest hook will always run last

I guess we will need to add an options to choose when to run hook as suggested here https://github.com/danethurber/webpack-manifest-plugin/issues/141#issuecomment-380536659

shellscape commented 3 years ago

Hey all! I've taken over maintenance of the plugin and am doing some housecleaning. If this is still a need, please open a new issue using the Feature template.