From 701d96a690c392ddf8e08f6d30c8c9c71d3bce00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20=C5=BBuraw?= <9116238+krzysztofzuraw@users.noreply.github.com> Date: Tue, 25 Apr 2023 08:33:09 +0200 Subject: [PATCH] Allow macaw-ui to be linked (#3539) --- vite.config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index 10558fd6f..930f28f97 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,7 +4,7 @@ import react from "@vitejs/plugin-react-swc"; import { copyFileSync } from "fs"; import path from "path"; import nodePolyfills from "rollup-plugin-polyfill-node"; -import { defineConfig, loadEnv } from "vite"; +import { defineConfig, loadEnv, searchForWorkspaceRoot } from "vite"; import { createHtmlPlugin } from "vite-plugin-html"; import { VitePWA } from "vite-plugin-pwa"; import viteSentry from "vite-plugin-sentry"; @@ -138,6 +138,9 @@ export default defineConfig(({ command, mode }) => { envDir: "..", server: { port: 9000, + fs: { + allow: [searchForWorkspaceRoot(process.cwd()), "../.."], + }, }, define: { ...globals, @@ -184,7 +187,7 @@ export default defineConfig(({ command, mode }) => { }, }, optimizeDeps: { - include: ["esm-dep > cjs-dep"], + include: ["esm-dep > cjs-dep", "@saleor/macaw-ui"], esbuildOptions: { plugins: [ /* @@ -196,6 +199,7 @@ export default defineConfig(({ command, mode }) => { }, }, resolve: { + dedupe: ["react", "react-dom", "clsx", "@material-ui/styles"], alias: { "@assets": path.resolve(__dirname, "./assets"), "@locale": path.resolve(__dirname, "./locale"),