Skip to content

Latest commit

 

History

History
100 lines (97 loc) · 2.62 KB

配置备忘录.md

File metadata and controls

100 lines (97 loc) · 2.62 KB

vscode设置

  • 扩展: chinese语言包 eslint markdownPreviewEnhance vetur python
  • 编辑器设置
{
  "git.ignoreMissingGitWarning": true,
  "editor.fontSize": 16,
  "window.zoomLevel": 1,
  "files.associations": {
    "*.tpl": "html",
    "*.wxml": "html"
  },
  "editor.tabSize": 2,
  "javascript.implicitProjectConfig.experimentalDecorators": true,
  "explorer.confirmDelete": false,
  // emmet支持jsx
  "emmet.includeLanguages": {
    "javascript": "javascriptreact"
  },
  "emmet.triggerExpansionOnTab": true,
  "explorer.confirmDragAndDrop": false,
  // 标签简写
  "workbench.editor.labelFormat": "short",
  "javascript.updateImportsOnFileMove.enabled": "never",
  // 保存自动修正为eslint规则
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}
  • 键盘设置
[
  {
    "key": "ctrl+m",
    "command": "markdown-preview-enhanced.openPreview",
    "when": "editorLangId == 'markdown'"
  },
  {
    "key": "ctrl+k v",
    "command": "-markdown-preview-enhanced.openPreview",
    "when": "editorLangId == 'markdown'"
  },
  {
    "key": "ctrl+d",
    "command": "editor.action.deleteLines",
    "when": "textInputFocus && !editorReadonly"
  },
  {
    "key": "ctrl+shift+k",
    "command": "-editor.action.deleteLines",
    "when": "textInputFocus && !editorReadonly"
  },
  {
    "key": "ctrl+r",
    "command": "workbench.action.terminal.toggleTerminal"
  },
  {
    "key": "ctrl+oem_3",
    "command": "-workbench.action.terminal.toggleTerminal"
  }
]
  • 常用插件
    eslint
    markdown preview enhanced
    vetur
    drawio

jenkins配置

  • Source Code Management
  • Build
    • add build step, 执行shell
      • npm i
      • npm run build
      • scp -i ~/.ssh/id_rsa -r ./dist/* [email protected]:/xxx/ROOT/xxx
      • 在jenkins服务器~/.ssh/id_rsa下生成私钥,在目标服务器上通过这个私钥配置公钥,scp将./dist/*文件都传输到目标服务器上

nginx配置

linux配置文件 vim /usr/local/nginx/conf/nginx.conf

  • location路由映射
  • gzip压缩
  • history路由
# abc是项目名称 访问地址是`http://www.xxx.com/abc`
location ^~/abc {
	# 一个域名下多项目 必须用alias不能用root 
	# /mypro/ROOT/abc是abc项目在服务器上的硬盘地址
	alias /mypro/ROOT/abc;
	index index.html;
	# abc项目下的所有路径 尝试访问$uri(当前url ) 没有就访问/abc/index.html
	try_files $uri $uri/ /abc/index.html;
}

nginx重启 cd /usr/local/nginx/sbin/ 然后 ./nginx -s reload 检查nginx配置是否正确 cd /usr/local/nginx/sbin/ 然后 ./nginx -t