Skip to content

Commit

Permalink
fix(build): preload treeshaking ignore equal (#17480)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Jun 14, 2024
1 parent d355568 commit 6ced135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const preloadMarkerRE = new RegExp(preloadMarker, 'g')
const dynamicImportPrefixRE = /import\s*\(/

const dynamicImportTreeshakenRE =
/((?:\bconst\s+|\blet\s+|\bvar\s+|,\s*)(\{[^}.]+\})\s*=\s*await\s+import\([^)]+\))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[\w$]+))|\bimport\([^)]+\)(\s*\.then\(\s*(?:function\s*)?\(\s*\{([^}.]+)\}\))/g
/((?:\bconst\s+|\blet\s+|\bvar\s+|,\s*)(\{[^}.=]+\})\s*=\s*await\s+import\([^)]+\))|(\(\s*await\s+import\([^)]+\)\s*\)(\??\.[\w$]+))|\bimport\([^)]+\)(\s*\.then\(\s*(?:function\s*)?\(\s*\{([^}.=]+)\}\))/g

function toRelativePath(filename: string, importer: string) {
const relPath = path.posix.relative(path.posix.dirname(importer), filename)
Expand Down

0 comments on commit 6ced135

Please sign in to comment.