vite-plugin-externals

JSON →
library 0.6.2 ·javascript
verified May 27, 2026

A Vite plugin that converts import statements into global variable lookups (window['Lib']), replicating Webpack's externals functionality for production builds. Version 0.6.2 requires Vite >=2.0.0 and Node ^14.18.0 || >=16.0.0. Unlike manual Rollup externals, this plugin transforms source code at the JS level, preserving static analysis. Released under MIT, with occasional updates. Key differentiator: supports deeply chained global paths (e.g., window['React']['lazy']) and works on JSX/TSX files after SFC transformation. Does not affect SSR by default; CJS/SSR users need separate handling.

total hits 21
actors 7 distinct systems
last hit 1d ago AhrefsBot
GPTBot
5
ByteDance
4
MetaBot
4
Script
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany