Skip to content

Commit

Permalink
🐛 Fix inspection functionality not working for Vue devtools (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
devtobi authored Jan 10, 2025
1 parent 5b235b2 commit 42a2b31
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 85 deletions.
71 changes: 37 additions & 34 deletions refarch-frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,44 @@ import vueDevTools from "vite-plugin-vue-devtools";
import vuetify, { transformAssetUrls } from "vite-plugin-vuetify";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
template: { transformAssetUrls },
features: {
optionsAPI: false,
export default defineConfig(({ mode }) => {
const isDevelopment = mode === "development";
return {
plugins: [
vue({
template: { transformAssetUrls },
features: {
optionsAPI: isDevelopment,
},
}),
vuetify({
autoImport: false,
}),
UnpluginFonts({
fontsource: {
families: [
{
name: "Roboto",
weights: [100, 300, 400, 500, 700, 900],
subset: "latin",
},
],
},
}),
vueDevTools(),
],
server: {
host: true,
port: 8081,
proxy: {
"/api": "http://localhost:8083",
"/actuator": "http://localhost:8083",
},
}),
vuetify({
autoImport: false,
}),
UnpluginFonts({
fontsource: {
families: [
{
name: "Roboto",
weights: [100, 300, 400, 500, 700, 900],
subset: "latin",
},
],
},
}),
vueDevTools(),
],
server: {
host: true,
port: 8081,
proxy: {
"/api": "http://localhost:8083",
"/actuator": "http://localhost:8083",
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
},
};
});
24 changes: 13 additions & 11 deletions refarch-frontend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import { defineConfig, mergeConfig } from "vitest/config";

import viteConfig from "./vite.config";

export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: "jsdom",
root: fileURLToPath(new URL("./", import.meta.url)),
server: {
deps: {
inline: ["vuetify"],
export default defineConfig((configEnv) =>
mergeConfig(
viteConfig(configEnv),
defineConfig({
test: {
environment: "jsdom",
root: fileURLToPath(new URL("./", import.meta.url)),
server: {
deps: {
inline: ["vuetify"],
},
},
},
},
})
})
)
);
67 changes: 35 additions & 32 deletions refarch-webcomponent/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,44 @@ import { defineConfig } from "vite";
import vueDevTools from "vite-plugin-vue-devtools";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
features: {
customElement: true,
optionsAPI: false,
export default defineConfig(({ mode }) => {
const isDevelopment = mode === "development";
return {
plugins: [
vue({
features: {
customElement: true,
optionsAPI: isDevelopment,
},
}),
vueDevTools(),
],
server: {
port: 8082,
proxy: {
"/api": "http://localhost:8083",
"/actuator": "http://localhost:8083",
"/clients": "http://localhost:8083",
},
}),
vueDevTools(),
],
server: {
port: 8082,
proxy: {
"/api": "http://localhost:8083",
"/actuator": "http://localhost:8083",
"/clients": "http://localhost:8083",
},
},
resolve: {
dedupe: ["vue"],
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
manifest: true, // required for post build logic in 'processes' folder
rollupOptions: {
input: {
"refarch-hello-world-webcomponent":
"./src/refarch-hello-world-webcomponent.ts",
resolve: {
dedupe: ["vue"],
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
output: {
entryFileNames: "entry-[name]-[hash].js",
dir: "dist/src",
},
build: {
manifest: true, // required for post build logic in 'processes' folder
rollupOptions: {
input: {
"refarch-hello-world-webcomponent":
"./src/refarch-hello-world-webcomponent.ts",
},
output: {
entryFileNames: "entry-[name]-[hash].js",
dir: "dist/src",
},
},
},
},
};
});
18 changes: 10 additions & 8 deletions refarch-webcomponent/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { defineConfig, mergeConfig } from "vitest/config";

import viteConfig from "./vite.config";

export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: "jsdom",
root: fileURLToPath(new URL("./", import.meta.url)),
},
})
export default defineConfig((configEnv) =>
mergeConfig(
viteConfig(configEnv),
defineConfig({
test: {
environment: "jsdom",
root: fileURLToPath(new URL("./", import.meta.url)),
},
})
)
);

0 comments on commit 42a2b31

Please sign in to comment.