Netlify 前端应用部署

文章目录

参考资料

  • Netlify将CI和nginx的功能揉合到了一份配置文件中;
  • 感觉是一套能适应所有前端应用部署的方案了;
  • 对于企业来说可能build配置可以放在部署平台的默认配置中,而不是必须在这个配置文件中;
build:
command: npm run build
publish: dist/

redirects:
from: /old-path
to: /new-path
status: 302
headers:
X-From: Netlify

# Response Header
headers:
values:
X-Frame-Options: DENY
Cache-Control: '''
max-age=0,
no-cache,
no-store,
must-revalidate
'''
Basic-Auth: someuser:somepassword anotheruser:anotherpassword