Merge pull request #7401 from researchgate/fix/runtime-chunk-filename

Fix: entrypoints use filename when runtimeChunk is used
This commit is contained in:
Tobias Koppers 2018-06-27 18:47:20 +02:00 committed by GitHub
commit c1cd6b4e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 11 deletions

View File

@ -99,8 +99,15 @@ class JavascriptModulesPlugin {
const outputOptions = options.outputOptions;
const moduleTemplates = options.moduleTemplates;
const dependencyTemplates = options.dependencyTemplates;
const filenameTemplate =
chunk.filenameTemplate || outputOptions.chunkFilename;
let filenameTemplate;
if (chunk.filenameTemplate) {
filenameTemplate = chunk.filenameTemplate;
} else if (chunk.isOnlyInitial()) {
filenameTemplate = outputOptions.filename;
} else {
filenameTemplate = outputOptions.chunkFilename;
}
result.push({
render: () =>

View File

@ -650,10 +650,10 @@ Child
Hash: 707868320b2a03412b3f
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
app.js 6.69 KiB 0 [emitted] app
vendor.6a3bdffda9f0de672978.js 619 bytes 1 [emitted] vendor
Entrypoint app = vendor.6a3bdffda9f0de672978.js app.js
Asset Size Chunks Chunk Names
app.js 6.69 KiB 0 [emitted] app
vendor.js 619 bytes 1 [emitted] vendor
Entrypoint app = vendor.js app.js
[./constants.js] 87 bytes {1} [built]
[./entry-1.js] ./entry-1.js + 2 modules 190 bytes {0} [built]
| ./entry-1.js 67 bytes [built]
@ -663,10 +663,10 @@ Child
Hash: e3b00ef4ecd794b284d6
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
app.js 6.7 KiB 0 [emitted] app
vendor.6a3bdffda9f0de672978.js 619 bytes 1 [emitted] vendor
Entrypoint app = vendor.6a3bdffda9f0de672978.js app.js
Asset Size Chunks Chunk Names
app.js 6.7 KiB 0 [emitted] app
vendor.js 619 bytes 1 [emitted] vendor
Entrypoint app = vendor.js app.js
[./constants.js] 87 bytes {1} [built]
[./entry-2.js] ./entry-2.js + 2 modules 197 bytes {0} [built]
| ./entry-2.js 67 bytes [built]

View File

@ -5,7 +5,8 @@ module.exports = {
e2: "./e2"
},
output: {
filename: "[name].js"
filename: "[name].js",
chunkFilename: "[name].chunk.js"
},
stats: {
hash: false,