-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: externalize typescript support #5858
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #5858 +/- ##
==========================================
+ Coverage 95.65% 95.73% +0.07%
==========================================
Files 82 80 -2
Lines 2695 2651 -44
Branches 693 678 -15
==========================================
- Hits 2578 2538 -40
+ Misses 99 97 -2
+ Partials 18 16 -2
Continue to review full report at Codecov.
|
@nuxt/core-team Alright, I made this PR ready to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lot of cleanup, good for me at first glance 👍
Types of changes
Description
External repo : https://github.com/nuxt/typescript
TODO before ready
dev
& mergedev
into the branch related to this PR@nuxt/typescript-build
,@nuxt/typescript-runtime
&@nuxt/types
packagesNotes for Nuxt 2.9 migration
TypeScript support has been externalized in dedicated packages and have been removed from core starting Nuxt 2.9. Here are the guidelines to migrate your existing Nuxt TypeScript project to 2.9 without any trouble.
The following migration guide works for either
nuxt
ornuxt-edge
.1) Migrate dependencies
2) Replace
@nuxt/vue-app
and@nuxt/config
by@nuxt/types
in yourtsconfig.json
If you were importing types from
@nuxt/config
you need to instead import them from@nuxt/types
. Types imports might have changed a little, you can get familiar with them either by triggering intellisense when importing or watch them live here now.3) Add
@nuxt/typescript-build
module to yournuxt.config.js
4) Move the customized options from
build.typescript
to module optionsYou can also do it this way :
5) [Optional] TypeScript runtime
Install
@nuxt/typescript-runtime
and usenuxt-ts
(ornuxts
alias) command instead ofnuxt
/nuxt-edge
to have TypeScript runtime and be able to use TypeScript in files executed at runtime such as configuration (nuxt.config.ts
),modules
andserverMiddlewares
.This migration guide & new project guide will be available on https://typescript.nuxtjs.org when the new dedicated documentation will be published. You'll also be able to find the main reasons why we went this way and we're also planning to write a post about the journey of the TypeScript support of Nuxt, from the oldest implementation to now.
Checklist: