之前是用的creact-react-app来创建的:npx create-react-app my-app
现在官网却推荐使用creact-next-app: npx create-next-app
我们把他所有的选项都选上
这里的css使用了tailwind
项目结构很奇怪啊,没找到.html文件,只在src/app/layout.tsx中找到了个html标签,也没找到page.tsx和layout.tsx的依赖关系,而且在page.tsx中有个main标签
npm run dev如下
这是用vite创建的react项目,可以看到这里是有index.html的(npm init vite)
npm run dev如下
这是用create-react-app创建的react项目,可以看到这里是有index.html的(npx creact-react-app my-project)
npm run start如下
上面用的是next14创建的项目create-next-app@14.2.5
create-next-app --version 查看版本