GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #6672 from EugeneHlushko/fix/6639 · webpack/webpack@b30de38

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • WebpackOptionsDefaulter.js
  • schemas
    • WebpackOptions.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/WebpackOptionsDefaulter.js‎

Copy file name to clipboardExpand all lines: lib/WebpackOptionsDefaulter.js
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,16 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
9191
this.set("output.filename", "[name].js");
9292
this.set("output.chunkFilename", "make", options => {
9393
const filename = options.output.filename;
94-
if (typeof filename === "function") return filename;
95-
const hasName = filename.includes("[name]");
96-
const hasId = filename.includes("[id]");
97-
const hasChunkHash = filename.includes("[chunkhash]");
98-
// Anything changing depending on chunk is fine
99-
if (hasChunkHash || hasName || hasId) return filename;
100-
// Elsewise prefix "[id]." in front of the basename to make it changing
101-
return filename.replace(/(^|\/)([^/]*(?:\?|$))/, "$1[id].$2");
94+
if (typeof filename !== "function") {
95+
const hasName = filename.includes("[name]");
96+
const hasId = filename.includes("[id]");
97+
const hasChunkHash = filename.includes("[chunkhash]");
98+
// Anything changing depending on chunk is fine
99+
if (hasChunkHash || hasName || hasId) return filename;
100+
// Elsewise prefix "[id]." in front of the basename to make it changing
101+
return filename.replace(/(^|\/)([^/]*(?:\?|$))/, "$1[id].$2");
102+
}
103+
return "[id].js";
102104
});
103105
this.set("output.webassemblyModuleFilename", "[modulehash].module.wasm");
104106
this.set("output.library", "");
Collapse file

‎schemas/WebpackOptions.json‎

Copy file name to clipboardExpand all lines: schemas/WebpackOptions.json
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,7 @@
324324
},
325325
"chunkFilename": {
326326
"description": "The filename of non-entry chunks as relative path inside the `output.path` directory.",
327-
"anyOf": [
328-
{
329-
"type": "string"
330-
},
331-
{
332-
"instanceof": "Function"
333-
}
334-
],
327+
"type": "string",
335328
"absolutePath": false
336329
},
337330
"webassemblyModuleFilename": {

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.