This is a simple starter kit for those who want to use TypeScript with Yarn Workspaces and Webpack.
The starter kit is also also configured to use Preact.
- Node.js 10.15.0
- Yarn 1.13.0
NODE_ENV
eg.production
PORT
eg.8080
For development:
cd ./packages/package-app
yarn start
For production:
cd ./packages/package-app
yarn build
There are a number of TypeScript loaders available for Webpack, such as ts-loader, and awesome-typescript-loader.
However, Babel now supports TypeScript through @babel/preset-typescript, so you can simply use babel-loader with @babel/preset-typescript and you're good to go!
Compilation speeds are also faster due to only using babel-loader.
Dynamic imports are also supported out of the box using @babel/plugin-syntax-dynamic-import.
- babel-loader
- @babel/preset-env
- @babel/preset-typescript
- @babel/plugin-syntax-dynamic-import
- @babel/polyfill
- terser-webpack-plugin