Merge pull request #24865 from marcpalm/patch-1

fix: remove async imports
This commit is contained in:
Ben Lambert
2024-05-24 15:33:37 +02:00
committed by GitHub
2 changed files with 11 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Fix issue with `esm` loaded dependencies being different from the `cjs` import for Vite dependencies
+6 -6
View File
@@ -165,12 +165,12 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be
});
if (process.env.EXPERIMENTAL_VITE) {
const vite = await import('vite');
const { default: viteReact } = await import('@vitejs/plugin-react');
const { nodePolyfills: viteNodePolyfills } = await import(
'vite-plugin-node-polyfills'
);
const { createHtmlPlugin: viteHtml } = await import('vite-plugin-html');
const vite = require('vite');
const { default: viteReact } = require('@vitejs/plugin-react');
const {
nodePolyfills: viteNodePolyfills,
} = require('vite-plugin-node-polyfills');
const { createHtmlPlugin: viteHtml } = require('vite-plugin-html');
viteServer = await vite.createServer({
define: {
global: 'window',