microsoft / TypeScript-Node-Starter

A reference example for TypeScript and Node with a detailed README describing how to use the two together.
MIT License
11.3k stars 2.76k forks source link

Transpile main.ts for browser and include jquery or other client libs #275

Closed pradosh987 closed 4 years ago

pradosh987 commented 4 years ago

While the starter project works great, I am little confused about importing jQuery or other npm libraries into main.ts required for browser. Do we need Webpack for it so that it transpires TS files and moves it to public directory? Right now main.ts is in src folder and not copied to public directory.

peterblazejewicz commented 4 years ago

@pradosh987 So this project is aligned with ideas and process setup created for this project: https://github.com/sahat/hackathon-starter So the client code in the src/public just gets transpiled using default tsconfig.json and tsc compiler into the relevant dist directory. No additional transpilation or module resolving, etc. The static assets from 'src/public/js/lib/are copied, the.tsfromsrc/public/jsare transpiled, you should see themain.jsandmain.js.mapthere after runningnpm run build`

pradosh987 commented 4 years ago

@peterblazejewicz Thanks for helpful reply. I ended up using parceljs to bundle js for client side code

peterblazejewicz commented 4 years ago

Cool, so can we close that one?