Skip to content

tsconfig paths not respected #8117

Closed
@buu700

Description

@buu700

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.8
node: 8.7.0
os: linux x64

Repro steps.

  1. ng serve https://github.com/buu700/ngcli-paths

  2. Either "success" or "failure" will be displayed.

Desired functionality.

tsconfig paths should be treated as equivalent to resolve.alias values, as far as I understand. However, it seems that they're only applying to imports from within the Angular project itself, not third-party modules. (I'd thought that this worked in the past, so it may be a recent regression.)

In this example, we're importing a node module test63987 that imports and re-exports an arbitrary second module (libsodium-wrappers-sumo). Setting "libsodium-wrappers-sumo": ["libsodium-replacement"] in tsconfig does not have the desired effect. However, ejecting and adding the equivalent alias to webpack.config.js does work as expected.

Mention any other details that might be useful.

Project this affects is https://github.com/cyph/cyph.


Edit: Workaround: Install the latest Angular/CLI/etc. and replace node_modules/@ngtools/webpack/src/paths-plugin.js with https://github.com/buu700/ngtools-webpack-tmp/blob/master/src/paths-plugin.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions