Closed victornoel closed 7 years ago
You may use the webpack's resolve.modules to do what you want to.
I have pushed this sample branch with an example: https://github.com/wallabyjs/ngCliWebpackSample/blob/absolutePaths/wallaby.js#L29. Specifying src/app
as a module root allows to import AppComponent here https://github.com/wallabyjs/ngCliWebpackSample/blob/absolutePaths/src/app/app.component.spec.ts#L3 by an absolute path. In your case:
resolve: {
modules: [
path.join(wallaby.projectCacheDir, 'src')
]
}
should be enough to do import { Workspaces } from 'app/...'
.
great, why not put it in the master branch then? It would make sense to have that by default… no?
@victornoel Fair enough, good point, done.
Hi,
In my typescript files, I often use absolute path for my imports:
In that case, wallabyjs can't find these modules because it thinks the file should be:
src/app/features/cockpit/workspaces/state/workspaces/workspaces.reducer.ts
instead.Is there any configuration that could be added to make this work in this case? It is a very common usage, and the auto-import functionality of vscode uses that by default.