Skip to content

Commit

Permalink
fix(@angular/cli): fix e2e after eject
Browse files Browse the repository at this point in the history
Start webpack-dev-server with e2e & sync its port with protractor default config port.

Close #4957
  • Loading branch information
Meligy authored and filipesilva committed Mar 3, 2017
1 parent 48324d1 commit 3b39843
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/@angular/cli/tasks/eject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@ export default Task.extend({
Your package.json scripts needs to not contain a start script as it will be overwritten.
`);
}
if (scripts['pree2e'] && scripts['prepree2e'] !== 'npm start' && !force) {
throw new SilentError(oneLine`
Your package.json scripts needs to not contain a prepree2e script as it will be
overwritten.
`);
}
if (scripts['pree2e'] && scripts['pree2e'] !== pree2eNpmScript && !force) {
throw new SilentError(oneLine`
Your package.json scripts needs to not contain a pree2e script as it will be
Expand All @@ -457,8 +463,9 @@ export default Task.extend({
}

packageJson['scripts']['build'] = 'webpack';
packageJson['scripts']['start'] = 'webpack-dev-server';
packageJson['scripts']['start'] = 'webpack-dev-server --port=4200';
packageJson['scripts']['test'] = 'karma start ./karma.conf.js';
packageJson['scripts']['prepree2e'] = 'npm start';
packageJson['scripts']['pree2e'] = pree2eNpmScript;
packageJson['scripts']['e2e'] = 'protractor ./protractor.conf.js';

Expand Down

0 comments on commit 3b39843

Please sign in to comment.