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

[Feature] NextJS 框架部署相关规则更新? #231

Open
StringKe opened this issue Jul 30, 2021 · 0 comments
Open

[Feature] NextJS 框架部署相关规则更新? #231

StringKe opened this issue Jul 30, 2021 · 0 comments

Comments

@StringKe
Copy link
Contributor

这个功能提议是否涉及到某个问题,请详细描述
**Is your feature request related to a problem? Please describe. **

  1. cloudbase-next-builder 组件会创建一个云函数,第一个 nextjs 占用内存够大。默认给的 128M 过小了
  2. 如果在 nuxt.config.js 里使用了一些 node 环境的第三方组件,这些组件应该算作 devDependencies 打包工具似乎未考虑这种场景,比如 preval-build-info
  3. cloudbase 提供的默认域名也太长了(本身是可以优化这些体验的)

next.config.js

// @ts-check
const info = require('preval-build-info');

/**
 * @type {import('next').NextConfig}
 **/
const nextConfig = {
	reactStrictMode: true,
	webpack5: true,
	generateBuildId: async () => {
// 获取git版本信息
		return `${info.version}-${info.gitHashShort}`;
	},
};

module.exports = nextConfig;

请对您遇到问题进行清楚、简洁的描述,比如我遇到一个问题,当我...
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

描述您期望的解决方案
Describe the solution you'd like

  1. 应该有一个按时间来计算的方式 比如 30s 最大内存消耗可以到2G,超过2G直接失败。(nextjs 项目我测试中每一次请求占用的内存大小都不一致,有时候浮动甚至超过+-300M左右的消耗)
  2. 考虑把 devDependencies 打包 ?或者提醒用户吧 next.config.js 中使用的包也添加到 Dependencies
  3. 国内地区需要备案,考虑上线香港?不过一个短域名会有什么其他影响么?

请详细描述您预期的效果
A clear and concise description of what you want to happen.

您认为可以接受的备选解决方案
Describe alternatives you've considered
第一点应该考虑一个方案, cloudbase-next-builder 被 cloudbase-plugin-next 包裹之后应该适当暴露一些参数以供参考。

请详细描述您希望的备选解决方案。
A clear and concise description of any alternative solutions or features you've considered.

其他上下文信息
Additional context

关于这个新功能提议,您可以添加一些上下文信息或者截图信息。
Add any other context or screenshots about the feature request here.

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

No branches or pull requests

1 participant