Skip to content

ng eject uses hardcoded project root #9335

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
SamVerschueren opened this issue Jan 23, 2018 · 3 comments · Fixed by #9346
Closed

ng eject uses hardcoded project root #9335

SamVerschueren opened this issue Jan 23, 2018 · 3 comments · Fixed by #9346

Comments

@SamVerschueren
Copy link

Versions

Angular CLI: 1.6.5 (e)
Node: 6.9.5
OS: darwin x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.1.0
@angular/cli: 1.6.5
@angular/material: 5.1.0
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.5.3
webpack-dev-server: 2.11.1
webpack: 3.10.0

Repro steps

  • ng new myproject
  • cd myproject
  • ng eject

Observed behavior

Open webpack.config.js and search for the projectRoot variable (line 25 on Angular-CLI@1.6.5). The value is a hardcoded string which is the path on the computer which ejected the project. In my case /Users/sam/Projects/myproject. Not only the projectRoot is hardcoded, also the glob patterns in the CopyWebpackPlugin and CircularDependencyPlugin are hardcoded.

Desired behavior

The projectRoot should be set to __dirname and should be reused in the plugins.

Mention any other details that might be useful (optional)

hansl added a commit to hansl/angular-cli that referenced this issue Jan 24, 2018
In favor of process.cwd(). Also added a new eject e2e test that verifies
the webpack.config.js does NOT have the project path in it at any place.

Fixed angular#9335.
hansl added a commit that referenced this issue Jan 24, 2018
In favor of process.cwd(). Also added a new eject e2e test that verifies
the webpack.config.js does NOT have the project path in it at any place.

Fixed #9335.
@SamVerschueren
Copy link
Author

Thanks for fixing @hansl!

hansl added a commit that referenced this issue Jan 25, 2018
In favor of process.cwd(). Also added a new eject e2e test that verifies
the webpack.config.js does NOT have the project path in it at any place.

Fixed #9335.
@kaplan81
Copy link

If I may, this fix only affects the project root. All other paths in the Webpack configuration are still hardcoded.

dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
In favor of process.cwd(). Also added a new eject e2e test that verifies
the webpack.config.js does NOT have the project path in it at any place.

Fixed angular#9335.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants