Allow macaw-ui to be linked (#3539)

This commit is contained in:
Krzysztof Żuraw 2023-04-25 08:33:09 +02:00 committed by GitHub
parent 5526763c4d
commit 701d96a690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"),