nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
268 stars 28 forks source link

fix: prevent typescript-build module utilized in defineNuxtConfig #1228

Closed saimonnozaki closed 3 weeks ago

saimonnozaki commented 1 month ago

🔗 Linked issue

❓ Type of change

📚 Description

This is the first time to send PR to this repository...(I do not have any confidence)

This PR prevents bridge from using both nuxt/typescript-build and bridge.typescript settings both. In my researching using bridge.typescript settings, I found that developers can utilize nuxt/typescript-build in modules array of defineNuxtConfig . (i.e. I could set like this modules: ['@nuxt/typescript-build']).

I guess that nuxt/bridge may have developers use either @nuxt/typescript-build or bridge.typescript , so I made this. Please review!

If necessary, I will be ready reproductions.

📝 Checklist

wattanx commented 3 weeks ago

Thank you!

It looks like setting @nuxtjs/typescript-build as a module is not recommended https://typescript.nuxtjs.org/guide/setup#configuration

I don't know if this module should consider something that is not recommended.

saimonnozaki commented 3 weeks ago

@wattanx

Thanks fou your replying.

It looks like setting @nuxtjs/typescript-build as a module is not recommended

This is true, I know.

By the way, let me ask one question. When we use nuxt/bridge with TypeScript, we may have to switch to nuxt.config.ts. In these case, should we toggle bridge.typescript on? Or, can we use nuxt/bridge by nuxt.config.js ?

In my local environment, when I tried to set both bridge.typescript: false and modules: ['@nuxt/typescript-build'] with Nuxt.js 2, Nuxt recognized TypeScript by '@nuxt/typescript-build'(I'm sorry I am not be ready to reproduction now...).

If I could not understand those TypeScript settings in nuxt/bridge, I will close this PR.

wattanx commented 3 weeks ago

You can also use @nuxt/bridge in nuxt.config.js.

The following environment is nuxt.config.js and bridge.typescript: true. https://stackblitz.com/edit/github-9xjfzr

saimonnozaki commented 3 weeks ago

Wow... I did not know that... I'm so sorry that I misunderstood. Thank you so much and I close this PR.