You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect files in the test directory to be transpiled with test/tsconfig.json, while files in the src directory are transpiled using src/tsconfig.json
Actual Behaviour
Both test and src files seems to be transpiled using the src/tsconfig.json file, which results in errors. In my demo application:
ERROR in C:\z\github\nicojs\ts-loader-issue\test\index.spec.ts
./test/index.spec.ts
[tsl] ERROR in C:\z\github\nicojs\ts-loader-issue\test\index.spec.ts(1,1)
TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.
Steps to Reproduce the Problem
Create a src/tsconfig.json file and a test/tsconfig.json file.
Add the config above in your webpack.conf.js file
Install @types/mocha (for example)
Add types: [] in src/tsconfig.json, types: ['mocha'] in test/tsconfig.json.
Create a file: test/index.spec.ts. Add a call to describe: describe('foo');
Run webpack
Location of a Minimal Repository that Demonstrates the Issue.
Expected Behaviour
Given this webpack config:
I would expect files in the
test
directory to be transpiled withtest/tsconfig.json
, while files in thesrc
directory are transpiled usingsrc/tsconfig.json
Actual Behaviour
Both test and src files seems to be transpiled using the
src/tsconfig.json
file, which results in errors. In my demo application:Steps to Reproduce the Problem
@types/mocha
(for example)types: []
in src/tsconfig.json,types: ['mocha']
in test/tsconfig.json.describe
:describe('foo');
Location of a Minimal Repository that Demonstrates the Issue.
https://github.com/nicojs/ts-loader-issue
Note: Tried to do this as a workaround for #851
The text was updated successfully, but these errors were encountered: