【问题标题】:Why is create-next-app command creating .tsx files instead of .js files?为什么 create-next-app 命令创建 .tsx 文件而不是 .js 文件?
【发布时间】:2022-01-28 08:15:49
【问题描述】:

似乎只有在命令行末尾添加 with-tailwindcss 时才会出现问题? npx create-next-app -e with-tailwindcss project_name

【问题讨论】:

    标签: javascript typescript next.js


    【解决方案1】:

    使用 Tailwind CSS 安装 Next.js 的正确方法是:

    npx create-next-app project_name
    cd project_name
    npm install -D tailwindcss postcss autoprefixer
    npx tailwindcss init -p
    

    更多:https://tailwindcss.com/docs/guides/nextjs

    【讨论】:

      【解决方案2】:

      您使用的with-tailwindcss 模板是使用打字稿设置的。

      您可以找到来源here on GitHub

      【讨论】:

        猜你喜欢
        • 2021-07-13
        • 2022-01-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-09-30
        • 2019-08-03
        • 2019-07-16
        • 1970-01-01
        相关资源
        最近更新 更多