'use strict'; var path = require('node:path'); var pluginutils = require('@rollup/pluginutils'); var oxcTransform$1 = require('oxc-transform'); var oxcResolver = require('oxc-resolver'); const INCLUDE_DEFAULT = /\.[mc]?[jt]sx?$/; const EXCLUDE_DEFAULT = /node_modules/; const EXTENSIONS_DEFAULT = ['.ts', '.tsx', '.mjs', '.js', '.cjs', '.jsx']; function oxcTransform(options = {}) { const { include = INCLUDE_DEFAULT, exclude = EXCLUDE_DEFAULT, resolveOptions, transformOptions, } = options; const filter = pluginutils.createFilter(include, exclude); const resolver = new oxcResolver.ResolverFactory({ conditionNames: ['node', 'import'], extensions: EXTENSIONS_DEFAULT, ...resolveOptions, }); return { name: 'rollup-plugin-oxc-transform', async resolveId(source, importer) { if (importer) { const resolverResult = await resolver.async(path.dirname(importer), source); if (resolverResult.error) { return this.error(resolverResult.error); } return resolverResult.path; } }, transform(code, id) { if (!filter(id)) return null; const transformResult = oxcTransform$1.transform(id, code, { ...transformOptions, sourcemap: true, }); return transformResult; }, }; } exports.oxcTransform = oxcTransform; //# sourceMappingURL=index.cjs.map