Webpack: Multiple Webpack entry points loaded

Created on 26 Feb 2016  路  3Comments  路  Source: webpack/webpack

I have a scenario where it is possible that multiple different entry points are loaded at the same time. These could be generated at different times and due to this ID's could conflict which can cause issues. Unfortunately there isn't anyway to ensure that they are generated together with common chunks etc. Is there a way to effectively namespace the id's generated for each different module with a unique id?

question

Most helpful comment

try setting unique function name in output.jsonpFunction

output: {
        jsonpFunction: 'webpackJsonp' + Date.now()
}

http://webpack.github.io/docs/configuration.html#output-jsonpfunction

All 3 comments

try setting unique function name in output.jsonpFunction

output: {
        jsonpFunction: 'webpackJsonp' + Date.now()
}

http://webpack.github.io/docs/configuration.html#output-jsonpfunction

Ah Cheers :+1: I was thinking of module id's but looks like this will do the trick thanks

It's safer to use module's id as unique element, because output of Date.now() won't differ at all on fast machines if you're generating multiple bundles in one run. I've just tested it on my config and 4/5 of my bundles share the same jsonpFunction name.

Was this page helpful?
0 / 5 - 0 ratings