8 ms·
I upgraded a universal React/typescript project from node 6.10 to 8.1 this week. Configured typescript compilation in webpack to target es2017 server-side and e
by Maarten88 9y ago
I upgraded a universal React/typescript project from node 6.10 to 8.1 this week. Configured typescript compilation in webpack to target es2017 server-side and es5 client-side. It worked flawlessly.
Debugging async functions (server-side) is a lot better now that there is no transpiler mangling my code beyond recognition.
- doomslice 9y agoWould you mind sharing your tsconfig(s)? And also do you use sourcemaps on the server?
- Maarten88 9y agoThis is my tsconfig.server.json: { "files": [], "compilerOptions": { "baseUrl": ".", "moduleResolution": "node", "target": "es2017", "jsx": "react", "experimentalDecorators": true, "sourceMap": true, "skipDefaultLibCheck": true, "lib": [ "es2017", "dom" ], "allowJs": false, "paths": { "*": [ "./ClientApp/types/*", "*" ] } }, "exclude": [ "bin", "obj", "node_modules" ] } edit: remove unneeded entries
- devrelm 9y agoLooking at "paths", shouldn't those @types (history, redux & react) be picked up automatically, at least as of TypeScript 2.0? Also: "*": [ "./ClientApp/types/*", "*" ] I like that. I may have to add it to my app and get rid of our typings.d.ts (currently included through "files") once and for all.
- Maarten88 9y agoThey were there to fix "Duplicate identifier" errors caused by multiple dependencies fetching their own copies of type definitions. But you are right: typescript or those dependencies have improved and they are no longer necessary. I removed them and everything still works.
- aussieguy1234 9y agoI had the same results with 8.0.