Skip to content

Framework Configuration

Here, we’ll cover how to configure your project for Pacy. Below is a quick overview of setups that require no configuration and those that do require configuration. Configuration is achieved using the @pacy-dev/plugin-devtools plugin.

  • React (v17-18) with Vite
  • React (v18) with Remix
  • Vue (v3) with Vite
  • Svelte with Vite
  • Next.js (v14, without Turbo)
  • React (v19) with Vite
  • Vue (v2) with Vite
  • Next.js (v15)
  • Others

Even if your setup requires no configuration, we still recommend using @pacy-dev/plugin-devtools for the smoothest experience and more accurate sourcemaps. This plugin is mostly a wrapper around code-inspector at the moment, and it works by adding data attributes to the DOM elements to track the source code location of the elements.

It supports bundlers such as Webpack, Vite, Esbuild, Rspack / Rsbuild, and Turbopack, and frameworks such as React, Vue, Svelte, Preact, Next.js, Nuxt, Solid, Astro, and Qwik.

Here, confiuration patterns for different setups are listed. There’s no need to specify the framework. You only need to specify the bundler. The plugin does different transforms based on the file extensions such as .jsx, .tsx, .vue, .astro, .svelte, etc.

This section is mostly taken from code-inspector’s configuration instructions.

vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react'
import pacyDevtools from '@pacy-dev/plugin-devtools';
export default defineConfig({
plugins: [
pacyDevtools({
bundler: 'vite',
}),
react(),
],
});
webpack.config.js
import pacyDevtools from '@pacy-dev/plugin-devtools';
module.exports = () => ({
plugins: [
pacyDevtools({
bundler: 'webpack',
}),
],
});
next.config.js
const pacyDevtools = require('@pacy-dev/plugin-devtools');
const nextConfig = {
webpack: (config, { dev, isServer }) => {
config.plugins.push(pacyDevtools({ bundler: 'webpack' }));
return config;
},
};
module.exports = nextConfig;
esbuild.config.js
const esbuild = require('esbuild');
import pacyDevtools from '@pacy-dev/plugin-devtools';
esbuild.build({
plugins: [pacyDevtools({ bundler: 'esbuild', dev: () => true })],
});
rspack.config.js
import pacyDevtools from '@pacy-dev/plugin-devtools';
module.exports = {
plugins: [
pacyDevtools({
bundler: 'rspack',
}),
// other plugins...
],
};
rsbuild.config.js
import pacyDevtools from '@pacy-dev/plugin-devtools';
module.exports = {
// other config...
tools: {
rspack: {
plugins: [
pacyDevtools({
bundler: 'rspack',
}),
],
},
},
};
vue.config.js
import pacyDevtools from '@pacy-dev/plugin-devtools';
module.exports = {
// ...other config
chainWebpack: (config) => {
config.plugin('@pacy-dev/plugin-devtools').use(
pacyDevtools({
bundler: 'webpack',
})
);
},
};

For nuxt3.x :

nuxt.config.js
import { pacyDevtools } from '@pacy-dev/plugin-devtools';
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
vite: {
plugins: [pacyDevtools({ bundler: 'vite' })],
},
});

For nuxt2.x :

nuxt.config.js
import { pacyDevtools } from '@pacy-dev/plugin-devtools';
export default {
build: {
extend(config) {
config.plugins.push(pacyDevtools({ bundler: 'webpack' }));
return config;
},
},
};
astro.config.mjs
import { defineConfig } from 'astro/config';
import { pacyDevtools } from '@pacy-dev/plugin-devtools';
export default defineConfig({
vite: {
plugins: [pacyDevtools({ bundler: 'vite' })],
},
});

@pacy-dev/plugin-devtools internally uses code-inspector. Thanks to all its contributors. You can surely use it directly, but we chose to wrap it in a plugin since we’re using it with the following non-default settings:

hideDomPathAttr: true,
hotKeys: false,
hideConsole: true,
pathType: 'absolute'