NPM安装strapi到现有的NextJS项目
我是React,NextJS和NPM的新手,我最近使用此命令创建了一个Next
应用程序: NPX Create-Next-App@最新
现在,我想在同一项目中添加strapi
。我使用此命令安装strapi: npx create-strapi-app@最新my-project -quickstart
使用此命令,它将为Strapi创建一个新项目。 我看到next
和strapi
项目共享许多文件,例如node_modules
文件夹中的文件。有没有办法在同一项目中将这些方法进行?还是会弄乱?
I'm new to React, NextJS, and Npm, I recently created a Next
app using this command:npx create-next-app@latest
And now I want to add Strapi
to the same project. I used this command to install Strapi:npx create-strapi-app@latest my-project --quickstart
Using this command, it will create a new project, for Strapi.
I see that the Next
and the Strapi
projects share a lot of files, such as the files in the node_modules
folder. Is there a way to have those in the same project? or would that make a mess?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得出的结论是,在两个不同的目录上拥有这两个应用程序,每个应用程序都有自己的配置文件和其他模块是正确的方法。我们最终将获得两个应用程序中存在的许多文件和文件夹,但是最好将这两个应用程序完全隔离,因为:
目录结构
很难使用的目录。在一个较大的项目中,我们可能会拥有更多
API
或应用程序
独立运行的应用程序,最好将这些目录和端口放在不同的目录和端口上。并且在所有应用程序中都有一些重复的文件,不会影响性能,并且不会花费太多存储。I came to the conclusion that having those two apps on two different directories, with each having their own config files, and other modules, is the right way. We will end up with a lot of files and folders that exist in both apps, but it is simply best that we isolate these two apps from each other completely, because:
Stapi
being thebackend api
and theadmin dashboard
, and theNextjs app
being the rest of the website.directory-structure
that would be very hard to work with.In a larger project we might have more
api
orapps
that run independently, and it's best to have those on different directories and ports. And having some duplicate files across all the apps, wouldn't affect performance, and wouldn't take much storage.