tsconfig-paths-webpack-plugin
tsconfig-paths-webpack-plugin copied to clipboard
TypeScript JavaScript interoperability problem
trafficstars
I'm using create-react-app-typescript and my tsconfig file as below:
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["esnext", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"resolveJsonModule": false,
"experimentalDecorators": true,
"paths": {
"@/*":["src/*"]
}
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
If I have src/components/Foo/index.js and src/components/Foo/index.d.ts.
I can't use import Foo from "@/components/Foo"; in my ts file.
@xiaoxiangmoe could you check to make sure your extensions config is in sync between webpack and the plugin as mentioned in this comment?