Skip to content
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

Enable watching files remapped by tsconfig paths #56

Open
Marcarrian opened this issue Feb 7, 2023 · 0 comments
Open

Enable watching files remapped by tsconfig paths #56

Marcarrian opened this issue Feb 7, 2023 · 0 comments

Comments

@Marcarrian
Copy link

We use tsconfig paths to remap locations when debugging our libraries in unit tests:

...
"paths": {
  "my-library": [
    "path-to-my-library"
  ]
}
...

Unfortunately, the files from my-library are not being watched by karma when running unit tests.

In karma.conf.js we have configured esbuild as follows:

...
files: [
  'src/**/*.spec.ts',
],
preprocessors: {
  'src/**/*.ts': ['esbuild'],
},
esbuild: {
  tsconfig: 'path-to-tsconfig/tsconfig.spec.json',
},
...

When using esbuild --watch to bundle the files, the paths specified in tsconfig are respected and a rebuild is triggered on any change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant