feat(plugins): isolate device integrations
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import wasm from "vite-plugin-wasm";
|
||||
@@ -8,6 +10,17 @@ export default defineConfig(({ mode }) => {
|
||||
|
||||
return {
|
||||
plugins: [react(), wasm()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@mission-core/plugin-sdk": fileURLToPath(
|
||||
new URL("./src/core/device-plugins/frontendSdk.ts", import.meta.url),
|
||||
),
|
||||
"@xgrids-k1/frontend": fileURLToPath(
|
||||
new URL("../../plugins/xgrids-k1/frontend/src", import.meta.url),
|
||||
),
|
||||
},
|
||||
dedupe: ["react", "react-dom", "@nodedc/ui-react"],
|
||||
},
|
||||
optimizeDeps: {
|
||||
// Rerun resolves its WASM asset relative to the package entrypoint. Vite's
|
||||
// dependency pre-bundler flattens that entrypoint and leaves the WASM URL
|
||||
@@ -21,6 +34,13 @@ export default defineConfig(({ mode }) => {
|
||||
host: "127.0.0.1",
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
fs: {
|
||||
allow: [
|
||||
fileURLToPath(new URL(".", import.meta.url)),
|
||||
fileURLToPath(new URL("../../plugins/xgrids-k1", import.meta.url)),
|
||||
fileURLToPath(new URL("../../../NODEDC_DESIGN_GUIDELINE/packages", import.meta.url)),
|
||||
],
|
||||
},
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: apiTarget,
|
||||
|
||||
Reference in New Issue
Block a user