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 { copyFileSync } from "fs";
import path from "path"; import path from "path";
import nodePolyfills from "rollup-plugin-polyfill-node"; 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 { createHtmlPlugin } from "vite-plugin-html";
import { VitePWA } from "vite-plugin-pwa"; import { VitePWA } from "vite-plugin-pwa";
import viteSentry from "vite-plugin-sentry"; import viteSentry from "vite-plugin-sentry";
@ -138,6 +138,9 @@ export default defineConfig(({ command, mode }) => {
envDir: "..", envDir: "..",
server: { server: {
port: 9000, port: 9000,
fs: {
allow: [searchForWorkspaceRoot(process.cwd()), "../.."],
},
}, },
define: { define: {
...globals, ...globals,
@ -184,7 +187,7 @@ export default defineConfig(({ command, mode }) => {
}, },
}, },
optimizeDeps: { optimizeDeps: {
include: ["esm-dep > cjs-dep"], include: ["esm-dep > cjs-dep", "@saleor/macaw-ui"],
esbuildOptions: { esbuildOptions: {
plugins: [ plugins: [
/* /*
@ -196,6 +199,7 @@ export default defineConfig(({ command, mode }) => {
}, },
}, },
resolve: { resolve: {
dedupe: ["react", "react-dom", "clsx", "@material-ui/styles"],
alias: { alias: {
"@assets": path.resolve(__dirname, "./assets"), "@assets": path.resolve(__dirname, "./assets"),
"@locale": path.resolve(__dirname, "./locale"), "@locale": path.resolve(__dirname, "./locale"),