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

simplify nextjs integratation #168

Open
tjx666 opened this issue May 25, 2024 · 4 comments
Open

simplify nextjs integratation #168

tjx666 opened this issue May 25, 2024 · 4 comments

Comments

@tjx666
Copy link
Contributor

tjx666 commented May 25, 2024

project next-devtools use react-dev-inspect internal.
But it can integrate to next project more easily:

// next.config.js
const { withNextDevtools } = require('@next-devtools/core/plugin')

module.exports = withNextDevtools({
  // Other Next.js configuration ...
})

看了下那个插件的源码,那个插件貌似是启了另外一个本地 server,那样的化确实简单些,但是需要额外的 server。目前的配置方式主要的不方便的地方是要从脚本启动,没法直接 next dev。不知道有没有办法直接通过修改 next.config.js 定义 next 中间件。

@zthxxx
Copy link
Owner

zthxxx commented May 26, 2024

想要达到什么样的配置写法呢? 也是形如 withNextDevtools() 这样包裹一层么

@tjx666
Copy link
Contributor Author

tjx666 commented May 26, 2024

@zthxxx 是的,那样最理想了,目前的方式只能通过脚本启动

@zthxxx
Copy link
Owner

zthxxx commented May 28, 2024

Got it! 我抽空去实现下

@tjx666
Copy link
Contributor Author

tjx666 commented Jun 15, 2024

目前用脚本启动最大的不方便点就是:不能使用 next 的一些需要使用 next cli + 命令行参数才能开启的能力,例如 turbopack 和 https

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

2 participants