'How to install Next.js Tailwind explicitly with .js?
I created a Next.js project and I only have .tsx
(TypeScript) as the extension everywhere. I know TypeScript is just extended like Java but I just want .js
as the file ending. I tried to extend the command (npx create-next-app -e with-tailwindcss my-project
) by adding --js
at the end. Apparently that didn't work. Then I tried to change the endings in the already created project, which just brought me a lot of errors. What can I do? Is this still possible? Best wishes.
Solution 1:[1]
By running the following command:
npx create-next-app -e with-tailwindcss my-project
You created a new project from a nextjs predefined template (that you can find here, in the nextjs repository).
As you can see, this template comes with typescript files by default. Since you are basically cloning this project, you cannot add a flag like --js
to convert it to plain javascript.
You can either manually convert the files to javascript, or initialise a normal nextjs app (using npx create-next-app@latest
, which is javascript only) and then installing tailwind separately (follow tailwind docs).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Sandro Maglione |