Skip to content

Conversation

timsu92
Copy link

@timsu92 timsu92 commented Jun 21, 2023

This PR tries to allow Nuxt3's config file nuxt.config.ts. However, it uses Typescript, which looks like not being supported by now.
I've completed the function and test. If there's anything I should modify, please let me know!

As TypeScript files aren't really supported (say if you write as NuxtConfig at the end, it's not going to recognize your config), I'm not modifying SUPPORTED_FILE_EXTENSIONS in set-pages-config.js. However, there's a need to modify those in other files for usual configs to work.

So, what is a currently accepted one? Well, if we type only key and values and don't write any type annotations, it's going to be fine.
Althought this may sounds silly since we are losing a huge functionality of TypeScript, I believe that kind of usage is really rare.

close #74

@timsu92 timsu92 requested a review from a team as a code owner June 21, 2023 12:52
const SUPPORTED_GENERATORS = ['next', 'nuxt', 'gatsby', 'sveltekit']
const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs']
const SUPPORTED_GENERATORS = ['next', 'nuxt', 'nuxt3', 'gatsby', 'sveltekit']
const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs', '.ts']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break Nextjs builds that make use of Typescript in its config with next.config.ts files. This is because the project uses espree to read and parse and modify configuration files and espree doesn't support typescript files. Besides, shouldn't this problem also happen with nuxt? I haven't checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The action ignores .ts config and creates default nuxt.config.js
2 participants