Webpack resolve extension not working for the TS Plugin
janwidmer opened this issue · 1 comments
janwidmer commented
I'm submitting a...
[ ] Regression (a behaviour that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behaviour
If you have a project (Nitro for example) and you enable typescript, resolving of the imports do not work.
Example Error, which happens for all imports:
ERROR in ./src/patterns/atoms/image/js/image.ts
Module not found: Error: Can't resolve 'lazysizes/plugins/respimg/ls.respimg' in '/Users/jawidmer/projects/test/src/patterns/atoms/image/js'
Manually setting the extensions in your webpack config fixes the problem:
webpackConfig.resolve.extensions = ['.ts', '.tsx', '.js', '.jsx', '.json', '.d.ts'];
Expected behaviour
Resolving the imports works out of the box, as the extensions for ts get defined here https://github.com/namics/webpack-config-plugins/blob/master/packages/ts-config-webpack-plugin/src/TsConfigWebpackPlugin.js#L73
Minimal reproduction of the problem with instructions
- Create new (nitro) project
- Enable typescript
- Start Server
Environment
Plugin version: 1.3.1
- Node version: 10.15.3
- Platform: Mac
jantimon commented
Seems to be a bug in nitro which unsets the .js
extension