diff --git a/build-scripts/vite.config.js b/build-scripts/vite.config.js index 29d781c..ba0f5f0 100644 --- a/build-scripts/vite.config.js +++ b/build-scripts/vite.config.js @@ -34,6 +34,12 @@ module.exports = defineConfig({ // See https://css-tricks.com/adding-vite-to-your-existing-web-app/#aa-aliases 'matrix-public-archive-shared': path.resolve(__dirname, '../shared'), }, + // This will make sure Vite/Rollup matches the original file path (i.e. the path + // without following symlinks) instead of the real file path (i.e. the path after + // following symlinks). This is useful when symlinking `hydrogen-view-sdk`, so it + // still matches our `/node_modules/` pattern in the `build.commonjsOptions.include` + // config below and gets converted from CommonJS to ESM as expected. + preserveSymlinks: true, }, build: { outDir: './dist',