File tree Expand file tree Collapse file tree 2 files changed +0
-25
lines changed Expand file tree Collapse file tree 2 files changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -32,24 +32,6 @@ export function shouldExternalize(
3232 return isExternal ( id , importer )
3333}
3434
35- const isConfiguredAsExternalCache = new WeakMap <
36- Environment ,
37- ( id : string , importer ?: string ) => boolean
38- > ( )
39-
40- export function isConfiguredAsExternal (
41- environment : Environment ,
42- id : string ,
43- importer ?: string ,
44- ) : boolean {
45- let isExternal = isConfiguredAsExternalCache . get ( environment )
46- if ( ! isExternal ) {
47- isExternal = createIsConfiguredAsExternal ( environment )
48- isConfiguredAsExternalCache . set ( environment , isExternal )
49- }
50- return isExternal ( id , importer )
51- }
52-
5335export function createIsConfiguredAsExternal (
5436 environment : PartialEnvironment ,
5537) : ( id : string , importer ?: string ) => boolean {
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import type {
77 ResolvedConfig ,
88} from '..'
99import type { Plugin } from '../plugin'
10- import { isConfiguredAsExternal } from '../external'
1110import {
1211 bareImportRE ,
1312 isInNodeModules ,
@@ -22,7 +21,6 @@ import { tryOptimizedResolve } from './resolve'
2221 */
2322export function preAliasPlugin ( config : ResolvedConfig ) : Plugin {
2423 const findPatterns = getAliasPatterns ( config . resolve . alias )
25- const isBuild = config . command === 'build'
2624 return {
2725 name : 'vite:pre-alias' ,
2826 async resolveId ( id , importer , options ) {
@@ -65,11 +63,6 @@ export function preAliasPlugin(config: ResolvedConfig): Plugin {
6563 ( isInNodeModules ( resolvedId ) ||
6664 optimizeDeps . include ?. includes ( id ) ) &&
6765 isOptimizable ( resolvedId , optimizeDeps ) &&
68- ! (
69- isBuild &&
70- ssr &&
71- isConfiguredAsExternal ( environment , id , importer )
72- ) &&
7366 ( ! ssr || optimizeAliasReplacementForSSR ( resolvedId , optimizeDeps ) )
7467 ) {
7568 // aliased dep has not yet been optimized
You can’t perform that action at this time.
0 commit comments