-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(webpack5): Remove 'ts-loader' from webpack 'javascript' configuration #9715
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
Conversation
…cause issues for JavaScript apps.
ts-loader
NativeScript/packages/webpack5/src/configuration/base.ts Lines 229 to 231 in 1601caf
Maybe it would make sense to provide a default config in those cases - my thinking here is that js projects can still benefit from occasionally using a ts file here & there. Alternatively, we can move the declaration to the NativeScript/packages/webpack5/src/configuration/base.ts Lines 245 to 257 in 1601caf
|
PR Checklist
What is the current behavior?
If there is an attempt to use a plugin dynamic import inside a JavaScript app, one will receive errors about
tsconfig.json
being missing aswebpack
will use lazy loading and try to load typescript definition files inside plugin.Specifically, it occurs when the require path itself is dynamic:
Perhaps, this can be solved by creating a
tsconfig.json
file but the point is that JavaScript apps should not bother with TS files and developers should not worry about TypeScript setup.Still, plugins include TS definition files and that confuses webpack in NS JavaScript apps.
What is the new behavior?
New behaviour will remove
ts-loader
if developers declare they use javascript configuration in webpack.Old webpack plugin excluded
ts-loader
fromwebpack.javascript.config
file but it seems that webpack5 makes sure most kinds of apps inherit it.