-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Typings not being resolved for webpack.config.ts #143
Comments
try adding |
Bulls-eye, that did the trick! |
Typings were removed because of #118 I keep this issue open as a reminder to add them back, but it is unlikely to happen before s-panferov/awesome-typescript-loader#484 is fixed. |
@jods4 I switched to In the end I noticed no difference in speed. It seems ts-loader has caught up (learned their lesson, maybe?). Regardless of that, I'm not sure why removing the typings was the better solution here. As far as I know any typing errors caused by external dependencies can be suppressed with That's an easy workaround whereas there is (apparently?) no workaround for getting the typings included when they're absent. |
Forcing These definitions apply to your build file, which is less important than your full app. The bug with There are workarounds on the build side as well:
|
I tested it just now and
That gives me this error: Using
I suppose, but that feels worse than having to set |
I don't like this situation either. The top priority is that starting a new app with Webpack should "just work". Fewer people write their build in TS so this is comparatively less important. I'm open to any suggestion or new idea that would make the situation better.
Maybe it's been resolved. If we can confirm that the problem was fixed I support bringing back the types in |
I tested it with a clean The So this tsconfig: "exclude": [
"node_modules",
"aurelia_project"
],
"filesGlob": [
"./src/**/*.ts",
"./test/**/*.ts",
"./custom_typings/**/*.d.ts"
], Is essentially saying "include everything except aurelia_project and node_modules". That includes top-level project files such as webpack.config.ts. Change it either to this: "exclude": [
"node_modules",
"aurelia_project",
"./*.ts"
] Or to this: "include": [
"./src/**/*.ts",
"./test/**/*.ts"
] And For clarification, there's 3 properties pertaining to input: "include", "exclude" and "files"
In all my projects I only ever specify "include". I think this is the cleanest solution. Only ["src"] for the build, and ["src", "test"] for testing. That's all you need in 99% of cases. I sort of knew this all along but I figured there must have been something I didn't know about "filesGlob". I triple checked the docs now, and I'm 100% sure it must be replaced with "include" in all aurelia projects (and checked for correctness) if we want everything to be consistent on the long term. |
@fkleuver that will result in tests being compiled and given to webpack.. always gives me headaches.. nice catch though. We should figure out tsconfig(s) for every cli/skeleton check them with both loaders.. and all cli included testers.. then we can proceed. I think |
@Alexander-Taran That's what's currently happening anyway. The example I gave changes as little as possible to the existing configuration. Removing "tests" from the glob might break stuff if we're having an "include" to begin with.
It should be quite simple as they're all very similar. I just learned that "filesGlob" is specific to the atom editor. It was never part of typescript itself. So to non-atom users it never did anything. "includes" will behave the way "filesGlob" was intended to. For atom users, nothing should change since "includes" does the same thing in typescript as "filesGlob" does in atom. This would also eliminate inconsistencies between non-atom users and atom users (@EisenbergEffect ? ;)) in how things are included/compiled. |
I agree. We want this to be as consistent as possible. @AshleyGrant can you look into updated the skeletons based on @fkleuver's PR to the CLI? |
Can we please either include the typings for Missing typings really get in the way, and having to work around it by adding your own |
When configuring webpack with a webpack.config.ts rather than a webpack.config.js, the typings are not properly resolved:
Everything works, it's just this error and the lack of typings/intellisense that makes the experience suboptimal.
I wouldn't mind submitting a PR if this is indeed a "bug", but I just want to make sure first that there's not some kind of setting that I'm missing.
The text was updated successfully, but these errors were encountered: