Skip to content

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

Open
@StringKe

Description

@StringKe
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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @StringKe

        Issue actions

          [Feature] NextJS 框架部署相关规则更新? · Issue #231 · Tencent/cloudbase-framework