Skip to content

ng eject uses hardcoded project root #9335

Closed

Description

@SamVerschueren

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)

Activity

  1. added a commit that references this issue on Jan 24, 2018
    dc7e932
  2. added a commit that references this issue on Jan 24, 2018
    1b57f12
  3. SamVerschueren commented on Jan 24, 2018

    @SamVerschueren
    Author

    Thanks for fixing @hansl!

  4. added a commit that references this issue on Jan 25, 2018
    53e84fe
  5. kaplan81 commented on Jan 30, 2018

    @kaplan81

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

  6. added a commit that references this issue on Apr 23, 2018
    7b696bc
  7. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 7, 2019
  9. added a commit that references this issue on May 29, 2026
    b35557d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions