Reputation: 523
I want to create NextJS monorepo using nx using javascript. I don't want to use TypeScript for my project. But I didn't found any solution or documentation or any blog in web. My question is: Can I create nx monorepo of NextJS without using typescript? If yes how can I? or Is there any another or alternative way to create nx monorepo of NextJS without Typescript.
Below command is used to create NextJS monorepo but here by default typescript is enabled
nx g @nrwl/next:app my-new-app
Docs of nx for NextJS: https://nx.dev/packages/next
I know that most of the packages are written in typescript and typescript. I think nx and NextJS also uses typescript.
I want to generate NextJS application setup in javascript. For example when we create new NextJS application we have two options
.jsx
)yarn create next-app
.tsx
)yarn create next-app --typescript
Reference: NextJS docs to create new application
When we create NextJS application using nx command its by default create typescript setup. But when I want to create it for JavaScript.
How to do that?
Upvotes: 1
Views: 1760
Reputation: 9350
There actually is a --js
flag option to generate a next.js application using JavaScript instead of TypeScript in a nx workspace. For some reason it is not stated in the official docs.
Here's an example:
nx g @nrwl/next:application my-app --js
In case you are using VSCode I'd also recommend using the Nx Console extension (nrwl.angular-console
). It helps a lot when generating apps, libs, components etc and shows you all available options including the --js
option as a neat checkbox.
Upvotes: 4