Skip to content

Commit

Permalink
feat(build) use appConfig.index to set output index file
Browse files Browse the repository at this point in the history
Pass appConfig.index to the HtmlWebpackPlugin’s filename property.

Closes #2241
  • Loading branch information
hollannikas committed Oct 21, 2016
1 parent 50c0f17 commit c16527c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/angular-cli/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export function getWebpackCommonConfig(
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(appRoot, appConfig.index),
filename: path.resolve(appConfig.outDir, appConfig.index),
chunksSortMode: 'dependency'
}),
new BaseHrefWebpackPlugin({
Expand Down
15 changes: 15 additions & 0 deletions tests/e2e/tests/build/filename.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {ng} from '../../utils/process';
import {expectFileToExist} from '../../utils/fs';
import {updateJsonFile} from '../../utils/project';


export default function() {
return Promise.resolve()
.then(() => updateJsonFile('angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['outDir'] = 'config-build-output';
app['index'] = 'config-index.html';
}))
.then(() => ng('build'))
.then(() => expectFileToExist('./config-build-output/config-index.html'));
}

0 comments on commit c16527c

Please sign in to comment.