Skip to content

Commit

Permalink
fix: avoid breaking change from #128
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Dec 28, 2023
1 parent fcea268 commit 4cc78b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Expand Up @@ -151,8 +151,10 @@ export default (opts: PluginOptions = {}): Plugin => {
},
async resolveId(id, importer, options) {
if (importer && !relativeImportRE.test(id) && !isAbsolute(id)) {
// For Vite 4 and under, skipSelf needs to be set.
const resolveOptions = { ...options, skipSelf: true }
const viteResolve: ViteResolve = async (id, importer) =>
(await this.resolve(id, importer, options))?.id
(await this.resolve(id, importer, resolveOptions))?.id

let prevProjectDir: string | undefined
let projectDir = dirname(importer)
Expand Down

0 comments on commit 4cc78b4

Please sign in to comment.