Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): only process index HTML if option…
Browse files Browse the repository at this point in the history
… is used
clydin authored and Keen Yee Liau committed Oct 4, 2018
1 parent 3bf2bb0 commit d9f73d7
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -39,6 +39,17 @@ export function getBrowserConfig(wco: WebpackConfigOptions) {
}
}

if (buildOptions.index) {
extraPlugins.push(new IndexHtmlWebpackPlugin({
input: path.resolve(root, buildOptions.index),
output: path.basename(buildOptions.index),
baseHref: buildOptions.baseHref,
entrypoints: generateEntryPoints(buildOptions),
deployUrl: buildOptions.deployUrl,
sri: buildOptions.subresourceIntegrity,
}));
}

if (buildOptions.subresourceIntegrity) {
extraPlugins.push(new SubresourceIntegrityPlugin({
hashFuncNames: ['sha384']
@@ -102,16 +113,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions) {
}
}
},
plugins: extraPlugins.concat([
new IndexHtmlWebpackPlugin({
input: path.resolve(root, buildOptions.index),
output: path.basename(buildOptions.index),
baseHref: buildOptions.baseHref,
entrypoints: generateEntryPoints(buildOptions),
deployUrl: buildOptions.deployUrl,
sri: buildOptions.subresourceIntegrity,
}),
]),
plugins: extraPlugins,
node: false,
};
}

0 comments on commit d9f73d7

Please sign in to comment.