-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
ts-loader ignores exclude in webpack loader config #544
Comments
I also tried: |
Put the excludes in the ts config instead. |
@quantuminformation if you're using a test runner, how do you run tests if the test files are in tsconfig.json exclude? I think in most cases you'll want your |
Wow, I also have the same issue, I need to exclude a /scaffold/ folder and it's not behaving correctly. Is this about to be fixed or is there an alternative to ts-loader that supports excluding folders? It doesn't work either in webpack-config.js or tsconfig.json :( |
This is what I ended up doing: tsconfig.webpack.json {
"extends": "./tsconfig",
"compilerOptions": {
"sourceMap": true
},
"exclude": [
"**/*.test.ts",
"node_modules"
]
} Then for my loader I do |
Thanks @lukescott , I actually managed to solve it by placing the relative folder path ( |
I'm using awesome typescript loader now, which seems to do all I need. |
Hi there, I'm running into this same issue. One of the npm libs I use has the I can compile my TS normally with
But with Webpack 3.5.5 and ts-loader 2.3.3 it keeps trying to compile the I tried using the suggestion above to extend my
But same issue. My folder structure is pretty basic.
Any clues what the issue could be? I'm at a bit of a loss on this one. Thanks! |
Thanks for the details - that's really helpful. I'm afraid I don't have any spare time to look at this at present. If you (or anyone else) does I'd be happy to assist. Help is always appreciated! |
Sorry, I feel dumb. Another plugin I was using had me add Sorry to bother you! Thanks for the awesome work! |
Great - thanks for sharing the resolution. This will help others! |
I was running into this problem and in my case the issue was my workspace is a monorepo and the project experiencing problems had it's tsconfig named |
The workaround with separate |
Excluding test files see: TypeStrong/ts-loader#544
same issues.I need to set exclude dynamically, so we can't use multiple tsconfig.json. |
Webpack is using this, which should explicitly ignore the test folder.
but it tried to compile my tests (which results in a failing as tests run in node and the webpack build doesn't expect assert to be available in a browser build )
ERROR in /Users/nikos/WebstormProjects/solar-popup/src/tests/SolarPopup.test.ts
(2,20): error TS2307: Cannot find module 'assert'.
The browser webpack build targets es2015:
The text was updated successfully, but these errors were encountered: