Creating web apps via TypeScript and webpack

https://2ality.com/2020/04/webpack-typescript.html

In order to build the web app, we need to compile two sets of files into the directory build/:

  • TypeScript files are stored in ts/.
  • HTML files are stored in html/.

Both tasks are handled by webpack:

  • For TypeScript, webpack starts at main.ts, locates all TypeScript and JavaScript files that are used, and compiles them into the single script file build/main-bundle.js. This process is called bundling. For compiling TypeScript to JavaScript, webpack uses the loader (plugin) ts-loader.

  • Copying the files in html/ is done via the webpack plugin copy-webpack-plugin.

posted on 2020-11-29 22:30  bowen_tong  阅读(39)  评论(0)    收藏  举报