diff --git a/packages/@stylexjs/unplugin/src/core.js b/packages/@stylexjs/unplugin/src/core.js index 340af13cf..53b22f18b 100644 --- a/packages/@stylexjs/unplugin/src/core.js +++ b/packages/@stylexjs/unplugin/src/core.js @@ -283,6 +283,7 @@ export const unpluginFactory = (userOptions = {}, metaOptions) => { async function runBabelTransform(inputCode, filename, callerName) { const result = await transformAsync(inputCode, { babelrc: false, + configFile: false, filename, presets, plugins: [ diff --git a/packages/@stylexjs/unplugin/src/vite.js b/packages/@stylexjs/unplugin/src/vite.js index 9510369c0..3d0c85494 100644 --- a/packages/@stylexjs/unplugin/src/vite.js +++ b/packages/@stylexjs/unplugin/src/vite.js @@ -87,6 +87,10 @@ function attachViteHooks(plugin) { } catch {} } }, 150); + // Unref the timer so it does not prevent the process from exiting + // (e.g. when Vitest runs the plugin in middleware mode without an + // HTTP server that emits 'close'). + interval.unref(); server.httpServer?.once('close', () => clearInterval(interval)); } },