Skip to content

fix(eject): start webpack-dev-server with e2e & sync its port with protractor default config port #4957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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