mirror of
https://github.com/LukeHagar/electron-vite.git
synced 2025-12-10 04:19:53 +00:00
Support subpath imports from externalized dependencies
Using an array of regular expressions for rollupOptions.external, I've fixed an issue causing subpath imports or external dependencies (e.g. import {} from 'pkg/subpath') to be bundled.
This commit is contained in:
@@ -33,7 +33,7 @@ export function externalizeDepsPlugin(options: ExternalOptions = {}): Plugin | n
|
|||||||
const defaultConfig = {
|
const defaultConfig = {
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: [...new Set(deps)]
|
external: [...new Set(deps.map(d => new RegExp(`^${d}\/?.*`)))]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user