ts react vite_or_webpack
1.0.0
有一個範例 use-webpack
這是一個簡單的(管理)入門程序,包含 typescript、react 和 vite。
快速瀏覽一下:
對於哈士奇
$ npm run prepare
如果不需要淘寶註冊表,可以在
.npmrc
中更改
$ npm i
$ npm test
$ npm run dev
$ npm run build:(qa/prod)
import React from 'react'
import { observer } from 'mobx-react'
import { Button } from 'antd'
import history from '@shared/App/ht'
function Test ( ) {
function gotoHome ( ) {
history . push ( '/' )
}
return (
< Button type = "primary" onClick = { gotoHome } >
go to page index directly
</ Button >
)
}
export default observer ( Test )
活生生的例子
ESLint
風格林特
Prettier - 代碼格式化程序
#! /bin/bash
TIMESPAN= $( date ' +%s ' )
DEPLOYNAME=ts-react.qa. ${TIMESPAN}
DEPLOYFILES= ${DEPLOYNAME} .tar.gz
SERVER=0.0.0.0
# make compression
cd dist/qa
tar -zcvf ${DEPLOYFILES} ./ *
# upload
scp -P 22 -o StrictHostKeyChecking=no ${DEPLOYFILES} node@ ${SERVER} :/home/pages/ts-react/tarfiles
# make decompression
ssh -p 22 -o StrictHostKeyChecking=no node@ ${SERVER} tar xzf /home/pages/ts-react/tarfiles/ ${DEPLOYFILES} -C /home/pages/ts-react
if [ $? -ne 0 ] ; then
echo " success "
else
echo " fail "
fi
server {
listen 9993 ;
server_name localhost:9993;
location / {
root ~ /Documents/react/ts-react/dist/qa/;
index index.html;
}
}
steamer-react-redux-ts