.. | ||
.vscode | ||
build | ||
public | ||
src | ||
.babelrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
package.json | ||
README.md | ||
tsconfig.json | ||
yarn.lock |
开始项目
cnpm 安装(可忽略)
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 设置匿名
alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"
# Or alias it in .bashrc or .zshrc
$ echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc
安装依赖
yarn
或
cnpm install
启动
yarn start
或
npm start
构建打包
yarn build
或
npm run build
代理配置
build/webpack.dev.conf.js
修改proxy属性
proxy: [{
context: ['/'],
changeOrigin: true,
secure: false,
target: 'http://ip:port',
}],