Install Locator on Preact codebase.
npm install -D @locator/babel-jsx
Add this to your vite.config.jsimport { defineConfig } from "vite";
import preact from "@preact/preset-vite";
export default defineConfig({
plugins: [
preact({
babel: {
plugins: [
[
"@locator/babel-jsx/dist",
{
env: "development",
},
],
],
},
}),
],
});
npm install -D @locator/runtime
import setupLocatorUI from "@locator/runtime";
if (process.env.NODE_ENV === "development") {
setupLocatorUI();
}