Skip to content

Commit d3fd8b0

Browse files
hollannikasfilipesilva
authored andcommitted
feat(build): use appConfig.index to set output index file
Pass appConfig.index to the HtmlWebpackPlugin’s filename property. Closes #2241 Closes #2767
1 parent a799a9c commit d3fd8b0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

packages/angular-cli/models/webpack-build-common.ts

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function getWebpackCommonConfig(
8686
plugins: [
8787
new HtmlWebpackPlugin({
8888
template: path.resolve(appRoot, appConfig.index),
89+
filename: path.resolve(appConfig.outDir, appConfig.index),
8990
chunksSortMode: 'dependency'
9091
}),
9192
new BaseHrefWebpackPlugin({

tests/e2e/tests/build/filename.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {ng} from '../../utils/process';
2+
import {expectFileToExist} from '../../utils/fs';
3+
import {updateJsonFile} from '../../utils/project';
4+
5+
6+
export default function() {
7+
return Promise.resolve()
8+
.then(() => updateJsonFile('angular-cli.json', configJson => {
9+
const app = configJson['apps'][0];
10+
app['outDir'] = 'config-build-output';
11+
app['index'] = 'config-index.html';
12+
}))
13+
.then(() => ng('build'))
14+
.then(() => expectFileToExist('./config-build-output/config-index.html'));
15+
}

0 commit comments

Comments
 (0)