Open ketan opened 7 years ago
Huh. Could have sworn we supported multiple chunks. Thanks for the issue.
Can you please submit this in a pull request?
I'm not sure if this will break webpack 1.x compatibility in any way...
Based on this spec, it looks like the manifest.json is supposed to look like —
{
"errors": [],
"assetsByChunkName": {
"entry1": [ "entry1.js", "entry1-a.js" ],
"entry2": "entry2.js"
}
}
However the actual manifest.json on my project looks like. Note that assetsByChunkName
is not an array.
{
"assetsByChunkName": {
"single_page_apps/agents": "single_page_apps/agents-e7560caa94a75cbca3b1.js",
"vendor-and-helpers.chunk": "vendor-and-helpers.chunk-22b0993852189b6bf4ca.js"
},
"assets": [
{
"name": "single_page_apps/agents-e7560caa94a75cbca3b1.js",
"chunkNames": [
"single_page_apps/agents"
]
},
],
"entrypoints": {
"single_page_apps/agents": {
"assets": [
"vendor-and-helpers.chunk-22b0993852189b6bf4ca.js",
"single_page_apps/agents-e7560caa94a75cbca3b1.js"
]
}
}
}
@mipearson — may I get some thoughts on my comment above?
It looks like this gem breaks when using multiple chunks.
The fix seems to be to change
Webpack::Rails::Manifest.asset_paths
to the following implenentation —