diff --git a/packages/vite/src/hbs.ts b/packages/vite/src/hbs.ts index ced752802..591b04cd8 100644 --- a/packages/vite/src/hbs.ts +++ b/packages/vite/src/hbs.ts @@ -7,7 +7,6 @@ import { hbsToJS } from '@embroider/core'; import assertNever from 'assert-never'; import { parse as pathParse } from 'path'; import makeDebug from 'debug'; -import { RollupModuleRequest } from './request'; const debug = makeDebug('embroider:hbs-plugin'); @@ -16,13 +15,14 @@ export function hbs(): Plugin { name: 'rollup-hbs-plugin', enforce: 'pre', async resolveId(source: string, importer: string | undefined, options) { - let request = RollupModuleRequest.from(source, importer, options.custom); - if (!request) { - // fallthrough to other rollup plugins + if (options.custom?.onlyResolver) { return null; } let resolution = await this.resolve(source, importer, { skipSelf: true, + custom: { + onlyResolver: true + } }); if (!resolution) { diff --git a/packages/vite/src/template-tag.ts b/packages/vite/src/template-tag.ts index 2512ca447..b1480b9f4 100644 --- a/packages/vite/src/template-tag.ts +++ b/packages/vite/src/template-tag.ts @@ -1,7 +1,6 @@ import { createFilter } from '@rollup/pluginutils'; import type { Plugin } from 'vite'; import { Preprocessor } from 'content-tag'; -import { RollupModuleRequest } from './request'; const gjsFilter = createFilter('**/*.gjs?(\\?)*'); @@ -17,13 +16,14 @@ export function templateTag(): Plugin { enforce: 'pre', async resolveId(id: string, importer: string | undefined, options) { - let request = RollupModuleRequest.from(id, importer, options.custom); - if (!request) { - // fallthrough to other rollup plugins + if (options.custom?.onlyResolver) { return null; } let resolution = await this.resolve(id, importer, { skipSelf: true, + custom: { + onlyResolver: true, + }, }); if (resolution) { return resolution; @@ -32,6 +32,7 @@ export function templateTag(): Plugin { resolution = await this.resolve(candidate, importer, { skipSelf: true, custom: { + onlyResolver: true, embroider: { enableCustomResolver: false, },