Skip to content

Wrong environment path generated in transloco-root.module when adding transloco with ng add if module path is not the default path  #332

@dorthrithil

Description

@dorthrithil

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

When adding transloco with the following command the generated environment import path is wrong in transloco-root.module:

ng add @ngneat/transloco --module app/some/path/app.module

The generated import is:

import {environment} from '../../environments/environment';

Expected behavior

The correct import is:

import {environment} from '../../../../environments/environment';

Minimal reproduction of the problem with instructions

  • Setup a new angular project and try to add transloco to a module that is not at the default app.module location.

Environment


Angular version: 9.0.7
 
For Tooling issues:
- Node version: v13.7.0
- Platform:  Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions