Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chunk-manifest.json contains only one entry #6

Open
alex35mil opened this issue Jul 24, 2015 · 6 comments
Open

chunk-manifest.json contains only one entry #6

alex35mil opened this issue Jul 24, 2015 · 6 comments

Comments

@alex35mil
Copy link

Hi,

There is something wrong with my setup or plugin.
Here is my webpack config: webpack.config.prod.js
My chunk-manifest.json contains only one entry:

{"1":"app-915536e5789438304214.js"}

And everything works even I don't provide webpackManifest global on the client.

@avissn
Copy link

avissn commented Aug 29, 2015

I too have same question. It seems to work without providing webpackmanifest in client

@jglapa
Copy link

jglapa commented Nov 3, 2015

I have similar problem. My chunk manifest doesn't contain all the entries but I'm missing 10 out of 11. I suspect this is because I'm using multiple entry points and I'm using multiple webpack.optimize.CommonsChunkPlugin configurations. My workaround is to extract the manifest manually by using the stats object which contain all necessary information.

var INCORRECT_CHUNKS_MANIFEST_FILENAME = 'wrong-chunks-manifest-file.json';
var ASSETS_MANIFEST_FILENAME = 'webpack-manifest.json';
var CHUNKS_MANIFEST_FILENAME = 'webpack-cache-manifest.json';
var ASSETS_MANIFEST_VARIABLE = 'webpackManifest';

...
plugins : [
...,
new ChunkManifestPlugin({
            filename: INCORRECT_CHUNKS_MANIFEST_FILENAME, // file is incorrect and should be ingored but manifestVariable needs to be injected so still using this plugin
            manifestVariable: ASSETS_MANIFEST_VARIABLE
        }),
 // generates correct chunks-manifest-file for js sources
        function() {
            this.plugin('done', function(stats) {
                var result = {}
                stats.toJson().assets.filter(function(item) {
                    return item.name.match('.js$') !== null
                }).forEach(function(item) {
                    result[item.chunks[0]] = item.name
                })
                fs.writeFileSync(
                    path.join(__dirname, CHUNKS_MANIFEST_FILENAME),
                    JSON.stringify(result));
            });
        },
    // Remove incorrectly generated file
        function() {
            this.plugin('done', function() {
                fs.unlink(path.join(config.output.path, INCORRECT_CHUNKS_MANIFEST_FILENAME)) // eslint-disable-line no-use-before-define
            });
        }
...

@tko
Copy link

tko commented Nov 20, 2015

I can also only see a single entry in the chunk manifest. It's missing the files produced by CommonsChunkPlugin and ExtractTextPlugin

@danny-andrews
Copy link

+1

@dcurletti
Copy link

Having the same issue, makes this plugin unusable. I'm assuming it has something to do with multiple entry points. Very unfortunate.

@burakcan
Copy link

any status on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants