diff --git a/.chronus/changes/feature-babel-preset-types-2026-7-21.md b/.chronus/changes/feature-babel-preset-types-2026-7-21.md new file mode 100644 index 000000000..7bc33fe24 --- /dev/null +++ b/.chronus/changes/feature-babel-preset-types-2026-7-21.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@alloy-js/babel-preset" +--- + +`@alloy-js/babel-preset` now ships with TypeScript type declarations, so consumers can import the preset without `@ts-expect-error`. diff --git a/.chronus/changes/feature-rollup-plugin-api-2026-7-21.md b/.chronus/changes/feature-rollup-plugin-api-2026-7-21.md new file mode 100644 index 000000000..7bde2b02f --- /dev/null +++ b/.chronus/changes/feature-rollup-plugin-api-2026-7-21.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@alloy-js/rollup-plugin" +--- + +The Rollup/Vite plugin now accepts `addSourceInfo` and `sourceMaps` options and automatically configures esbuild for Alloy (`jsx: "preserve"` plus the `source` resolve conditions). Consumers no longer need to set these by hand in their Vite/Vitest config. diff --git a/.chronus/changes/internal-share-babel-config-2026-7-21.md b/.chronus/changes/internal-share-babel-config-2026-7-21.md new file mode 100644 index 000000000..303b79f3b --- /dev/null +++ b/.chronus/changes/internal-share-babel-config-2026-7-21.md @@ -0,0 +1,17 @@ +--- +changeKind: internal +packages: + - "@alloy-js/cli" + - "@alloy-js/core" + - "@alloy-js/csharp" + - "@alloy-js/go" + - "@alloy-js/java" + - "@alloy-js/json" + - "@alloy-js/markdown" + - "@alloy-js/msbuild" + - "@alloy-js/python" + - "@alloy-js/typescript" + - "@alloy-js/typespec" +--- + +Rely on the Rollup/Vite plugin to configure esbuild, removing the duplicated esbuild/resolve boilerplate from each package's `vitest.config.ts`. diff --git a/packages/babel-preset-alloy/index.js b/packages/babel-preset-alloy/index.js deleted file mode 100644 index a61d7cfba..000000000 --- a/packages/babel-preset-alloy/index.js +++ /dev/null @@ -1,38 +0,0 @@ -import alloyTransform from "@alloy-js/babel-plugin"; -import jsxTransform from "@alloy-js/babel-plugin-jsx-dom-expressions"; - -export default function (context, options = {}) { - const envMode = process.env.BABEL_ENV ?? process.env.NODE_ENV; - const inferredDev = envMode === undefined ? true : envMode !== "production"; - const defaultOptions = { - alloyModuleName: "@alloy-js/core", - moduleName: "@alloy-js/core/jsx-runtime", - generate: "universal", - wrapConditionals: true, - preserveWhitespace: true, - }; - - const jsxOptions = Object.assign({}, defaultOptions, options); - if (options.addSourceInfo === undefined) { - if (options.dev !== undefined) { - jsxOptions.addSourceInfo = options.dev; - } else { - jsxOptions.addSourceInfo = inferredDev; - } - } - - const plugins = [ - [ - alloyTransform, - { - alloyModuleName: - options.alloyModuleName ?? defaultOptions.alloyModuleName, - legacyWhitespace: - options.legacyWhitespace ?? defaultOptions.legacyWhitespace, - }, - ], - [jsxTransform, jsxOptions], - ]; - - return { plugins }; -} diff --git a/packages/babel-preset-alloy/package.json b/packages/babel-preset-alloy/package.json index acb60938e..08daff839 100644 --- a/packages/babel-preset-alloy/package.json +++ b/packages/babel-preset-alloy/package.json @@ -1,21 +1,52 @@ { "name": "@alloy-js/babel-preset", "version": "0.3.0", - "description": "", + "type": "module", + "description": "Babel preset for Alloy's JSX/TSX transformation", + "homepage": "https://github.com/alloy-framework/alloy", + "license": "MIT", + "author": "Microsoft", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "source": "./src/index.ts", + "default": "./dist/index.js" + } + }, + "publishConfig": { + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], "repository": { "type": "git", "url": "git+https://github.com/alloy-framework/alloy.git" }, - "main": "index.js", + "engines": { + "node": ">=22.0.0" + }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "watch": "tsc -p ./tsconfig.build.json --watch", + "build": "tsc -p ./tsconfig.build.json", + "clean": "rimraf dist/ .temp/" }, "dependencies": { "@alloy-js/babel-plugin": "workspace:~", "@alloy-js/babel-plugin-jsx-dom-expressions": "workspace:~" }, - "keywords": [], - "author": "", - "license": "MIT", - "type": "module" + "devDependencies": { + "@babel/core": "catalog:", + "@types/node": "catalog:", + "rimraf": "catalog:", + "typescript": "catalog:" + }, + "bugs": "https://github.com/alloy-framework/alloy/issues" } diff --git a/packages/babel-preset-alloy/src/index.ts b/packages/babel-preset-alloy/src/index.ts new file mode 100644 index 000000000..a99ef2d3b --- /dev/null +++ b/packages/babel-preset-alloy/src/index.ts @@ -0,0 +1,73 @@ +import alloyTransform from "@alloy-js/babel-plugin"; +import jsxTransform from "@alloy-js/babel-plugin-jsx-dom-expressions"; +import type { PluginItem } from "@babel/core"; + +/** Options accepted by the Alloy Babel preset. */ +export interface AlloyPresetOptions { + /** Module name providing the Alloy runtime. @default "@alloy-js/core" */ + alloyModuleName?: string; + /** Module name providing the JSX runtime. @default "@alloy-js/core/jsx-runtime" */ + moduleName?: string; + /** Code generation mode passed to the JSX transform. @default "universal" */ + generate?: string; + /** Whether to wrap conditional expressions. @default true */ + wrapConditionals?: boolean; + /** Preserve JSX whitespace. @default true */ + preserveWhitespace?: boolean; + /** Opt into the legacy whitespace handling (not recommended). */ + legacyWhitespace?: boolean; + /** + * Emit source location information for components. When omitted, this is + * inferred from `dev` or from `BABEL_ENV`/`NODE_ENV`. + */ + addSourceInfo?: boolean; + /** Whether this is a development build. Used to infer `addSourceInfo`. */ + dev?: boolean; +} + +/** + * Alloy Babel preset. Transforms Alloy's JSX syntax into calls against the + * Alloy runtime. + */ +export default function alloyPreset( + _context: unknown, + options: AlloyPresetOptions = {}, +): { plugins: PluginItem[] } { + const envMode = process.env.BABEL_ENV ?? process.env.NODE_ENV; + const inferredDev = envMode === undefined ? true : envMode !== "production"; + const defaultOptions = { + alloyModuleName: "@alloy-js/core", + moduleName: "@alloy-js/core/jsx-runtime", + generate: "universal", + wrapConditionals: true, + preserveWhitespace: true, + }; + + const jsxOptions = { + ...defaultOptions, + ...options, + } as Record; + if (options.addSourceInfo === undefined) { + if (options.dev !== undefined) { + jsxOptions.addSourceInfo = options.dev; + } else { + jsxOptions.addSourceInfo = inferredDev; + } + } + + // `@babel/core`'s `PluginItem` type does not model the Alloy plugins' custom + // option objects, so assert comparability here. + const plugins = [ + [ + alloyTransform, + { + alloyModuleName: + options.alloyModuleName ?? defaultOptions.alloyModuleName, + legacyWhitespace: options.legacyWhitespace, + }, + ], + [jsxTransform, jsxOptions], + ] as PluginItem[]; + + return { plugins }; +} diff --git a/packages/babel-preset-alloy/src/vendored-plugins.d.ts b/packages/babel-preset-alloy/src/vendored-plugins.d.ts new file mode 100644 index 000000000..f82a5d3c5 --- /dev/null +++ b/packages/babel-preset-alloy/src/vendored-plugins.d.ts @@ -0,0 +1,7 @@ +// `@alloy-js/babel-plugin-jsx-dom-expressions` ships as plain JS without type +// declarations, so provide a minimal ambient declaration for it here. +declare module "@alloy-js/babel-plugin-jsx-dom-expressions" { + import type { PluginObj } from "@babel/core"; + const plugin: (...args: unknown[]) => PluginObj; + export default plugin; +} diff --git a/packages/babel-preset-alloy/tsconfig.build.json b/packages/babel-preset-alloy/tsconfig.build.json new file mode 100644 index 000000000..b1135e0c5 --- /dev/null +++ b/packages/babel-preset-alloy/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + "references": [], + "include": ["src"], + "exclude": ["**/*.test.*", "test/**/*"] +} diff --git a/packages/babel-preset-alloy/tsconfig.json b/packages/babel-preset-alloy/tsconfig.json new file mode 100644 index 000000000..cfd2ed456 --- /dev/null +++ b/packages/babel-preset-alloy/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "declaration": true, + "outDir": "dist" + }, + "include": ["src/**/*.ts", "src/**/*.d.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/cli/src/babel.ts b/packages/cli/src/babel.ts index 86cd0c07f..9cefafec1 100644 --- a/packages/cli/src/babel.ts +++ b/packages/cli/src/babel.ts @@ -1,7 +1,5 @@ import { mkdir, writeFile } from "node:fs/promises"; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error import alloyPreset from "@alloy-js/babel-preset"; import * as babel from "@babel/core"; import typescriptPreset from "@babel/preset-typescript"; diff --git a/packages/core/test/babel-e2e.test.ts b/packages/core/test/babel-e2e.test.ts index 118b662b6..0360ee762 100644 --- a/packages/core/test/babel-e2e.test.ts +++ b/packages/core/test/babel-e2e.test.ts @@ -10,7 +10,6 @@ * intrinsics returning AlloyNodes eagerly). */ -// @ts-expect-error — preset has no types import alloyPreset from "@alloy-js/babel-preset"; import { transformSync } from "@babel/core"; import typescriptPreset from "@babel/preset-typescript"; diff --git a/packages/core/test/output-e2e.test.ts b/packages/core/test/output-e2e.test.ts index 46fe90709..5af2ffdf9 100644 --- a/packages/core/test/output-e2e.test.ts +++ b/packages/core/test/output-e2e.test.ts @@ -10,7 +10,6 @@ * - `For` works under the runtime emitting multiple files. */ -// @ts-expect-error — preset has no types import alloyPreset from "@alloy-js/babel-preset"; import { transformSync } from "@babel/core"; import typescriptPreset from "@babel/preset-typescript"; diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/core/vitest.config.ts +++ b/packages/core/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/csharp/vitest.config.ts b/packages/csharp/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/csharp/vitest.config.ts +++ b/packages/csharp/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/go/vitest.config.ts b/packages/go/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/go/vitest.config.ts +++ b/packages/go/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/java/vitest.config.ts b/packages/java/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/java/vitest.config.ts +++ b/packages/java/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/json/vitest.config.ts b/packages/json/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/json/vitest.config.ts +++ b/packages/json/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/markdown/vitest.config.ts b/packages/markdown/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/markdown/vitest.config.ts +++ b/packages/markdown/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/msbuild/vitest.config.ts b/packages/msbuild/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/msbuild/vitest.config.ts +++ b/packages/msbuild/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/python/vitest.config.ts b/packages/python/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/python/vitest.config.ts +++ b/packages/python/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/rollup-plugin/package.json b/packages/rollup-plugin/package.json index 4ece62297..9f586e70f 100644 --- a/packages/rollup-plugin/package.json +++ b/packages/rollup-plugin/package.json @@ -28,7 +28,7 @@ "url": "git+https://github.com/alloy-framework/alloy.git" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" }, "scripts": { "watch": "tsc -p ./tsconfig.build.json --watch", @@ -45,6 +45,7 @@ "devDependencies": { "@types/node": "catalog:", "typescript": "catalog:", + "vite": "catalog:", "vitest": "catalog:" }, "bugs": "https://github.com/alloy-framework/alloy/issues" diff --git a/packages/rollup-plugin/src/index.ts b/packages/rollup-plugin/src/index.ts index b5b89a8e8..581d4c67e 100644 --- a/packages/rollup-plugin/src/index.ts +++ b/packages/rollup-plugin/src/index.ts @@ -1,24 +1,58 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error import alloyPreset from "@alloy-js/babel-preset"; import typescriptPreset from "@babel/preset-typescript"; import { babel } from "@rollup/plugin-babel"; +import type { Plugin, PluginOption } from "vite"; -export interface AlloyPluginOptions {} +export interface AlloyPluginOptions { + /** + * Emit source location information for components (used by the devtools). + * When omitted, the Alloy preset infers this from `BABEL_ENV`/`NODE_ENV`. + */ + addSourceInfo?: boolean; + /** + * How Babel should emit source maps for the transformed files. + * + * @default "both" + */ + sourceMaps?: boolean | "inline" | "both"; +} /** * Rollup/Vite plugin that handles Alloy's JSX syntax transformation. * * @remarks - * Do not set `esbuild.jsx: "automatic"` or `jsxImportSource` — esbuild must - * defer JSX processing to this plugin (set `esbuild.jsx: "preserve"`). + * When used with Vite (including Vitest) this plugin also configures the + * built-in transformer to defer JSX processing to Babel (`oxc.jsx: "preserve"`) + * and adds the `source` resolve condition, so consumers no longer need to set + * these by hand. Do not set the transformer's JSX handling to `"automatic"` or a + * `jsxImportSource` — doing so prevents this plugin from transforming Alloy's + * JSX. */ -export default function alloyPlugin(options: AlloyPluginOptions = {}): any { - return babel({ +export default function alloyPlugin( + options: AlloyPluginOptions = {}, +): PluginOption { + const configPlugin: Plugin = { + name: "alloy:config", + // Vite-only hook; ignored by plain Rollup. + config() { + return { + oxc: { jsx: "preserve" }, + resolve: { conditions: ["source"] }, + ssr: { resolve: { conditions: ["source"] } }, + }; + }, + }; + + const transformPlugin = babel({ inputSourceMap: true as any, - sourceMaps: "both", + sourceMaps: options.sourceMaps ?? "both", babelHelpers: "bundled", extensions: [".ts", ".tsx"], - presets: [typescriptPreset, [alloyPreset]], + presets: [ + typescriptPreset, + [alloyPreset, { addSourceInfo: options.addSourceInfo }], + ], }); + + return [configPlugin, transformPlugin as Plugin]; } diff --git a/packages/typescript/vitest.config.ts b/packages/typescript/vitest.config.ts index af9520a9f..05bb30644 100644 --- a/packages/typescript/vitest.config.ts +++ b/packages/typescript/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, test: { exclude: ["**/dist/**", "**/node_modules/**"], setupFiles: ["./test/vitest.setup.ts"], diff --git a/packages/typespec/vitest.config.ts b/packages/typespec/vitest.config.ts index b7862b4ee..cd14dbf09 100644 --- a/packages/typespec/vitest.config.ts +++ b/packages/typespec/vitest.config.ts @@ -2,18 +2,6 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - resolve: { - conditions: ["source"], - }, - ssr: { - resolve: { - conditions: ["source"], - }, - }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], test: { exclude: ["**/dist/**", "**/node_modules/**"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 053dbfa22..057588b9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -343,6 +343,19 @@ importers: '@alloy-js/babel-plugin-jsx-dom-expressions': specifier: workspace:~ version: link:../babel-plugin-jsx-dom-expressions + devDependencies: + '@babel/core': + specifier: 'catalog:' + version: 8.0.1 + '@types/node': + specifier: 'catalog:' + version: 26.1.1 + rimraf: + specifier: 'catalog:' + version: 6.1.3 + typescript: + specifier: 'catalog:' + version: 7.0.2 packages/cli: dependencies: @@ -912,7 +925,7 @@ importers: version: 8.0.1(@babel/core@8.0.1) '@rollup/plugin-babel': specifier: 'catalog:' - version: 7.1.0(@babel/core@8.0.1)(rollup@4.62.2) + version: 7.1.0(@babel/core@8.0.1)(rollup@4.62.2)(supports-color@8.1.1) devDependencies: '@types/node': specifier: 'catalog:' @@ -920,6 +933,9 @@ importers: typescript: specifier: 'catalog:' version: 7.0.2 + vite: + specifier: 'catalog:' + version: 8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0) vitest: specifier: 'catalog:' version: 4.1.10(@types/node@26.1.1)(vite@8.1.5(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.1)(yaml@2.9.0)) @@ -6693,9 +6709,9 @@ snapshots: '@babel/traverse': 8.0.4 '@babel/types': 8.0.4 - '@babel/helper-module-imports@7.29.7': + '@babel/helper-module-imports@7.29.7(supports-color@8.1.1)': dependencies: - '@babel/traverse': 7.29.7 + '@babel/traverse': 7.29.7(supports-color@8.1.1) '@babel/types': 7.29.7 transitivePeerDependencies: - supports-color @@ -6800,7 +6816,7 @@ snapshots: '@babel/parser': 8.0.4 '@babel/types': 8.0.4 - '@babel/traverse@7.29.7': + '@babel/traverse@7.29.7(supports-color@8.1.1)': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.7 @@ -8151,10 +8167,10 @@ snapshots: '@rolldown/pluginutils@1.0.1': {} - '@rollup/plugin-babel@7.1.0(@babel/core@8.0.1)(rollup@4.62.2)': + '@rollup/plugin-babel@7.1.0(@babel/core@8.0.1)(rollup@4.62.2)(supports-color@8.1.1)': dependencies: '@babel/core': 8.0.1 - '@babel/helper-module-imports': 7.29.7 + '@babel/helper-module-imports': 7.29.7(supports-color@8.1.1) '@rollup/pluginutils': 5.4.0(rollup@4.62.2) workerpool: 9.3.4 optionalDependencies: diff --git a/samples/basic-project/vitest.config.ts b/samples/basic-project/vitest.config.ts index f05f0ab40..4e1f52a87 100644 --- a/samples/basic-project/vitest.config.ts +++ b/samples/basic-project/vitest.config.ts @@ -6,9 +6,5 @@ export default defineConfig({ include: ["test/**/*.ts", "test/**/*.tsx"], exclude: ["test/**/*.util.ts", "test/**/*.d.ts"], }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], }); diff --git a/samples/client-emitter/vitest.config.ts b/samples/client-emitter/vitest.config.ts index f05f0ab40..4e1f52a87 100644 --- a/samples/client-emitter/vitest.config.ts +++ b/samples/client-emitter/vitest.config.ts @@ -6,9 +6,5 @@ export default defineConfig({ include: ["test/**/*.ts", "test/**/*.tsx"], exclude: ["test/**/*.util.ts", "test/**/*.d.ts"], }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], }); diff --git a/samples/go-example/vitest.config.ts b/samples/go-example/vitest.config.ts index ba661c0a9..01359c94a 100644 --- a/samples/go-example/vitest.config.ts +++ b/samples/go-example/vitest.config.ts @@ -2,9 +2,5 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], }); diff --git a/samples/python-example/vitest.config.ts b/samples/python-example/vitest.config.ts index ba661c0a9..01359c94a 100644 --- a/samples/python-example/vitest.config.ts +++ b/samples/python-example/vitest.config.ts @@ -2,9 +2,5 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], }); diff --git a/samples/scaffold-generator/vitest.config.ts b/samples/scaffold-generator/vitest.config.ts index f05f0ab40..4e1f52a87 100644 --- a/samples/scaffold-generator/vitest.config.ts +++ b/samples/scaffold-generator/vitest.config.ts @@ -6,9 +6,5 @@ export default defineConfig({ include: ["test/**/*.ts", "test/**/*.tsx"], exclude: ["test/**/*.util.ts", "test/**/*.d.ts"], }, - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], }); diff --git a/test/performance/vitest.config.ts b/test/performance/vitest.config.ts index ba661c0a9..01359c94a 100644 --- a/test/performance/vitest.config.ts +++ b/test/performance/vitest.config.ts @@ -2,9 +2,5 @@ import alloyPlugin from "@alloy-js/rollup-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ - esbuild: { - jsx: "preserve", - sourcemap: "both", - }, plugins: [alloyPlugin()], });