Skip to content

Commit

Permalink
Merge pull request #24865 from marcpalm/patch-1
Browse files Browse the repository at this point in the history
fix: remove async imports
  • Loading branch information
benjdlambert committed May 24, 2024
2 parents 024b530 + c00f7ee commit 08f2fd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-teachers-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---

Fix issue with `esm` loaded dependencies being different from the `cjs` import for Vite dependencies
12 changes: 6 additions & 6 deletions packages/cli/src/lib/bundler/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 08f2fd4

Please sign in to comment.