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
Closes #2767
  • Loading branch information
hollannikas authored and filipesilva committed Oct 28, 2016
1 parent a799a9c commit d3fd8b0
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 @@ -86,6 +86,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 d3fd8b0

Please sign in to comment.