Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

基于NextJS的静态式部署,有两个问题 🤔 #36

Closed
BetterLuke opened this issue Mar 25, 2021 · 4 comments
Closed

基于NextJS的静态式部署,有两个问题 🤔 #36

BetterLuke opened this issue Mar 25, 2021 · 4 comments
Labels

Comments

@BetterLuke
Copy link

BetterLuke commented Mar 25, 2021

  1. 每次部署完后,都需要打开浏览器,跑到bucket管理页面中里手动设置 忽略html扩展名选项,不然直接手动访问导出到页面会返回bucket默认到404错误页面:
    image

2. 我使用NextJS开发的前端工程,使用框架自带到yarn build && next export 作为serverless配置文件里到到hook 配置,但是发现没有按照预期实现env.js正常生成与注入到window变量中。 ->已自行解决 😄

希望官方到大佬关注一下萌新,我愿意协助一起调查这个问题,帮助大家更好到使用腾讯云到serverless :D

@BetterLuke BetterLuke changed the title 基于NextJS的next export导出式静态部署,有两个问题 基于NextJS的静态式部署,有两个问题 Mar 25, 2021
@BetterLuke BetterLuke changed the title 基于NextJS的静态式部署,有两个问题 基于NextJS的静态式部署,有两个问题 🤔 Mar 25, 2021
@yugasun
Copy link
Contributor

yugasun commented Mar 26, 2021

@BetterLuke 感谢反馈,”忽略html扩展名“ 功能是 COS 新增能力,这里组件也会进行支持,请关注下先关 PR 的发布。

yugasun added a commit that referenced this issue Mar 26, 2021
slsplus added a commit that referenced this issue Mar 26, 2021
## [0.1.4](v0.1.3...v0.1.4) (2021-03-26)

### Bug Fixes

* support ignoreHtmlExt, close [#36](#36) ([c86009d](c86009d))
@slsplus
Copy link
Collaborator

slsplus commented Mar 26, 2021

🎉 This issue has been resolved in version 0.1.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@yugasun
Copy link
Contributor

yugasun commented Mar 26, 2021

@BetterLuke 如果要忽略 html 后缀,只需要 serverless.yml 中新增 ignoreHtmlExt 配置,如下:

app: appDemo
stage: dev
component: website
name: websiteDemo

inputs:
  src:
    src: ./src
    index: index.html
    error: index.html
  region: ap-guangzhou
  ignoreHtmlExt: true  # 指定忽略 html 后缀
  bucketName: my-bucket
  protocol: https

@BetterLuke
Copy link
Author

@BetterLuke 如果要忽略 html 后缀,只需要 serverless.yml 中新增 ignoreHtmlExt 配置,如下:

app: appDemo
stage: dev
component: website
name: websiteDemo

inputs:
  src:
    src: ./src
    index: index.html
    error: index.html
  region: ap-guangzhou
  ignoreHtmlExt: true  # 指定忽略 html 后缀
  bucketName: my-bucket
  protocol: https

完美!真心感谢 ❤️

向大佬们respect,你们出feature的速度简直比我写bug的速度都快 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants