Skip to content

Commit

Permalink
remove explicit babel configFile from esbuild resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Mar 21, 2024
1 parent 7d20854 commit 31dc85f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/esbuild-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ResolverLoader, virtualContent, locateEmbroiderWorkingDir } from '@embr
import { readFileSync, readJSONSync } from 'fs-extra';
import { EsBuildModuleRequest } from './esbuild-request';
import assertNever from 'assert-never';
import { resolve, join } from 'path';
import { resolve } from 'path';
import { hbsToJS } from '@embroider/core';
import { Preprocessor } from 'content-tag';

Expand Down Expand Up @@ -82,7 +82,6 @@ export function esBuildResolver(root = process.cwd()): EsBuildPlugin {
const code = readFileSync(filename, 'utf8');

const result = transform(preprocessor.process(code, { filename }), {
configFile: join(process.cwd(), 'babel.config.js'),
filename,
});

Expand All @@ -98,7 +97,7 @@ export function esBuildResolver(root = process.cwd()): EsBuildPlugin {
build.onLoad({ filter: /\.hbs$/ }, async ({ path: filename }) => {
const code = readFileSync(filename, 'utf8');

const result = transform(hbsToJS(code), { configFile: join(process.cwd(), 'babel.config.js'), filename });
const result = transform(hbsToJS(code), { filename });

if (!result || !result.code) {
throw new Error(`Failed to load file ${filename} in esbuild-hbs-loader`);
Expand Down

0 comments on commit 31dc85f

Please sign in to comment.