readme
A mouth ago. I have write two cli/templte 两个template.
But react-typescript-webpack-cli has a big problem, too slow to compile, so I have refactor the code.
The reason of “Why do you write this article in english?” is that I want to improve my english.
I’ll insist on writing though there will be a lot of grammatical mistakes.
reason of slow
Because I had use ts-loader
to compile .tsx
files, It will waste too much time when first time to
start webpack-dev-server or build by webpack.
how to slove
Use tsc watch .ts
files change and compile immediately. So webpack can receive js files as entry, and
ts-loader is nolonger needed.
When build application, run tsc
commander then use webpack to package js files. If environment is
production, use babel compile .es6
to .es5
and compress it with uglifyJsPlugin
.
nokit
I have use nokit as my command line tools, Use it can be very convenient
to spawn or exec command. It was develop by my mentor.
source code
usege
dev
1 | yarn run dev |
production
will convert to es5 and minify
1 | yarn run production |
tree caglog
1 | ├── dist |