{"version":3,"names":["_path","data","require","normalizeOptions","config","filename","cwd","filenameRelative","path","relative","sourceType","inputSourceMap","sourceMaps","sourceRoot","options","moduleRoot","sourceFileName","basename","comments","compact","opts","Object","assign","parserOpts","extname","plugins","generatorOpts","auxiliaryCommentBefore","auxiliaryCommentAfter","retainLines","shouldPrintComment","minified","passes","plugin","manipulateOptions"],"sources":["../../src/transformation/normalize-opts.ts"],"sourcesContent":["import path from \"path\";\nimport type { ResolvedConfig } from \"../config/index.ts\";\n\nexport default function normalizeOptions(config: ResolvedConfig) {\n const {\n filename,\n cwd,\n filenameRelative = typeof filename === \"string\"\n ? path.relative(cwd, filename)\n : \"unknown\",\n sourceType = \"module\",\n inputSourceMap,\n sourceMaps = !!inputSourceMap,\n sourceRoot = process.env.BABEL_8_BREAKING\n ? undefined\n : config.options.moduleRoot,\n\n sourceFileName = path.basename(filenameRelative),\n\n comments = true,\n compact = \"auto\",\n } = config.options;\n\n const opts = config.options;\n\n const options = {\n ...opts,\n\n parserOpts: {\n sourceType:\n path.extname(filenameRelative) === \".mjs\" ? \"module\" : sourceType,\n\n sourceFileName: filename,\n plugins: [],\n ...opts.parserOpts,\n },\n\n generatorOpts: {\n // General generator flags.\n filename,\n\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n retainLines: opts.retainLines,\n comments,\n shouldPrintComment: opts.shouldPrintComment,\n compact,\n minified: opts.minified,\n\n // Source-map generation flags.\n sourceMaps,\n\n sourceRoot,\n sourceFileName,\n ...opts.generatorOpts,\n },\n };\n\n for (const plugins of config.passes) {\n for (const plugin of plugins) {\n if (plugin.manipulateOptions) {\n plugin.manipulateOptions(options, options.parserOpts);\n }\n }\n }\n\n return options;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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