Nuxt DevTools is a game changer, and this post shares what’s so exciting about it. It’s one of the best developer tools around and provides a full-stack experience unlike any other.
Nuxt DevTools ships by default in Nuxt and has been getting a lot of attention. Honestly, it’s probably the best developer tool around right now and provides you with a full-stack experience unlike any other.
If you don’t know about it yet, it was released during Vue.js Amsterdam in 2023 by Anthony Fu (a core team member of Vue, Vite and Nuxt). While it took me a while to start using it, it would be hard to go back to a project without it.
You are probably familiar with using Chrome or Safari DevTools and don’t want to deal with another layer of inspection. But the Nuxt DevTools is a game changer and I will try to also make you excited about it. 😍
Reason #1: You will be faster to get productive in an unfamiliar codebase. If you are new to a project, you should open it before diving into the codebase as it will give you a quick overview of many things. I also believe it’s a great way to learn Nuxt faster. 👩🏫
Reason #2: It will improve your developer experience which is the key to great software. For instance, you have an integrated developer’s experience that is very powerful and easy to use, especially if you are using the server routes and the API of Nuxt.
Reason #3: It improves transparency about what Nuxt is doing under the hood. There are a lot of abstractions to Nuxt as it aims to be a zero-config framework. That’s why it’s great sometimes to see what is going on behind the curtain. To give you an example, you can see the timing of things to understand how much time it takes to run. You can inspect what is happening in your app in real time. There is a lot of magic in Nuxt, and the Nuxt DevTools allows you to put back the curtain and see what is going on behind the scenes. It is about making stuff visible with less friction. 🏄♀️
Reason #4: It’s extensible, interactive and playful. For instance, you can run your unit tests directly from the DevTools with Vitest.
Reason #5: It’s faster to inspect the code of a component than with the Vue Devtools. By the way, it is designed to work together with Vue Devtools so you can use both.
There are a lot of features in Nuxt DevTools. I will try to cover all the things I enjoy, but I don’t want to flood you with too many images. To keep things digestible, I will create an image for each feature and display a list of every point you should know about this feature. 😃
Also, my goal is to provide you with real-world examples so you can grasp the value each feature can have in your day-to-day work. 👩💻
Nuxt DevTools will only work for Nuxt 3.1 and above and ships by default with Nuxt now. But there are two solutions to install it—one for you only and one for everyone on your team.
# Will be installed as a global module and only activated for the projects you enabled.
# The configuration is stored in your ~/.nuxtrc file so it does not affect your team.
npx nuxi@latest devtools enable
# To disable it per project
npx nuxi@latest devtools disable
## You can also install directly in your project but it will be activated for all your team members.
npm i -D @nuxt/devtools
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxt/devtools']
})
Restart your Nuxt server and you should see the floating Nuxt icon at the bottom of your page. You can drag this tab anywhere in dev mode. I enjoy putting it in the bottom left corner.
There is an inspect tool you can click to select a component and open the file in your editor. You can see how much time it took to load the page and clicking on the Nuxt icon will open the DevTools. You are also one shortcut away with Shift + Alt / ⇧ Shift + ⌥ Option + D to toggle it. 💁♀️
It’s a floating panel that you can resize as you wish, so feel free to move it anywhere on your app.
Tips: You can toggle light and dark modes by clicking on the Nuxt icon and even split the screen to open two tabs of the DevTools side by side. 🧞♀️
useState
or useAsyncData
.useFetch
.vite-plugin-inspect
integration, allowing you to inspect the transformation steps of Vite.Module and integration can contribute to their features in the DevTools. And believe me, the Vue ecosystem is fantastic. Here are a few features that will be added to your DevTools when you install a specific module.
If you want to add your features to the DevTools, you just have to embed your iframe. This can be very useful for your team to have a custom feature that is specific to your project or a specific package.
Nuxt DevTools are constantly evolving. For instance, a feature to improve the accessibility of our apps is in the works.
Of course, some people don’t like the DevTools and they will tell you should master your VS Code and browser debugger instead. In my opinion, they are right and wrong and it’s a complementary tool that can be useful in a lot of situations. On the other hand, it’s best to use it globally so your team is not forced to use it (see the part about the installation).
I also have some coworkers who told me it was making things slower for them and not everyone has the latest MacBook so your environment should be as light as possible. 🏃♀️
Other than that, I hope you will enjoy the Nuxt DevTools as much as I do. It’s a great tool to have in your toolbox and I hope you will be able to use it to its full potential. 🚀
You can reach me on Twitter @RifkiNada. And in case you are curious about my work or other articles, you can look at them here www.nadarifki.com. 😉
Thank you for reading! 🙏
Nada is a JavaScript developer who likes to play with UI components to create interfaces with great UX. She specializes in Vue/Nuxt, and loves sharing anything and everything that could help her fellow frontend web developers. Nada also dabbles in digital marketing, dance and Chinese. You can reach her on Twitter @RifkiNada or visit her website, nadarifki.com.