Skip to content

Commit e7d51be

Browse files
committed
feat: add filePattern option to builder
Added the filePattern option the the ngsscbuild builder, which allows to override the default, which is taken from the build configuration. closes #37
1 parent 2f0a161 commit e7d51be

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

builders/ngsscbuild/ngssc-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class NgsscBuilder {
106106
...ngsscContext.variables.map(m => m.variable),
107107
...(this._options.additionalEnvironmentVariables || []),
108108
],
109-
filePattern: basename(browserOptions.index),
109+
filePattern: this._options.filePattern || basename(browserOptions.index),
110110
variant: ngsscContext.variant,
111111
};
112112
await writeFileAsync(join(outputPath, 'ngssc.json'), JSON.stringify(ngssc, null, 2), 'utf8');

builders/ngsscbuild/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"ngsscEnvironmentFile": {
1818
"type": "string",
1919
"description": "The ngssc environment file (usually src/environments/environment.prod.ts)"
20+
},
21+
"filePattern": {
22+
"type": "string",
23+
"description": "The file pattern, into which the environment variables should be inserted during ngssc insert (Defaults to index.html)"
2024
}
2125
}
2226
}

models/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export interface Options extends JsonObject {
55
aotSupport: boolean;
66
browserTarget: string;
77
ngsscEnvironmentFile: string;
8+
filePattern: string | null;
89
}

0 commit comments

Comments
 (0)