Skip to content

Commit d101d64

Browse files
hi-ogawabluwy
andauthored
chore: deprecate ResolvedConfig.createResolver and recommend createIdResolver (vitejs#20031)
Co-authored-by: Bjorn Lu <[email protected]>
1 parent 338081d commit d101d64

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/vite/src/node/config.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,16 @@ export interface ResolvedConfig
606606
ssr: ResolvedSSROptions
607607
assetsInclude: (file: string) => boolean
608608
logger: Logger
609+
/**
610+
* Create an internal resolver to be used in special scenarios, e.g.
611+
* optimizer & handling css `@imports`.
612+
*
613+
* This API is deprecated. It only works for the client and ssr
614+
* environments. The `aliasOnly` option is also not being used anymore.
615+
* Plugins should move to `createIdResolver(environment.config)` instead.
616+
*
617+
* @deprecated Use `createIdResolver` from `vite` instead.
618+
*/
609619
createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn
610620
optimizeDeps: DepOptimizationOptions
611621
/** @internal */
@@ -1514,13 +1524,6 @@ export async function resolveConfig(
15141524
getSortedPlugins: undefined!,
15151525
getSortedPluginHooks: undefined!,
15161526

1517-
/**
1518-
* createResolver is deprecated. It only works for the client and ssr
1519-
* environments. The `aliasOnly` option is also not being used any more
1520-
* Plugins should move to createIdResolver(environment) instead.
1521-
* create an internal resolver to be used in special scenarios, e.g.
1522-
* optimizer & handling css @imports
1523-
*/
15241527
createResolver(options) {
15251528
const resolve = createIdResolver(this, options)
15261529
const clientEnvironment = new PartialEnvironment('client', this)

0 commit comments

Comments
 (0)