-
[] image handle
-
[] media (such as _.mp3 , _.wav file) file-loader
-
[] cdn publicPath handle
-
[] dev/produciton mode split the config
-
[] Compress JS (uglify-js)
-
[] Compress Css (postcss, purgecss for remove unused css)
-
[] Copy Webpack Plugin
-
[] maybe add DefinePlugin
-
[] maybe add the svg font handle
-
[] cypress test suite.
-
[] dts gen tool
- clone the project
git clone https://github.com/CosPie/Typescript-with-Babel-and-Webpack-Starter-kit.git
- install dependencies
npm install
# or
yarn install
- run webpack-dev-server
npm run dev
- Install QuickType VSCODE ext
- create the dto
[name].json
- open it and use QuickType generate interface
- copy/paste to the dto.d.ts
- Use babel-loader to transform
*.ts
file to*.js
with no type-check , and then it can improved performance.
see more detail:TypeScript With Babel: A Beautiful Marriage - I Am Turns
- if you want to use the type-check ,
npm run check-types
I prefer to use Scss css-pre-processing rather than etc.(such as less).
-
use prettier
-
use eslint to format
*.ts
file to replace tslint.
- Namespaces.
Solution: don’t use them! They’re outdated. Use the industry standard ES6 modules (import / export) instead. The recommended tslint rules ensure namespaces are not used.
-
Casting a type with the
<newtype>x
syntax.Solution: Use x as newtype instead.
-
Const enums.
This is a shame. Need to resort to regular enums for now.
-
Legacy-style import / export syntax.
Examples: import foo = require(...) and export = foo.