From 6da0956ab486b45cefb3f3658829b6836c9b5a4f Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 12 Mar 2026 11:56:31 +0100 Subject: [PATCH 1/2] add source-map test --- packages/@tailwindcss-node/src/source-maps.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 packages/@tailwindcss-node/src/source-maps.test.ts diff --git a/packages/@tailwindcss-node/src/source-maps.test.ts b/packages/@tailwindcss-node/src/source-maps.test.ts new file mode 100644 index 000000000000..96ff8f05cc5b --- /dev/null +++ b/packages/@tailwindcss-node/src/source-maps.test.ts @@ -0,0 +1,8 @@ +import { expect, it } from 'vitest' +import { toSourceMap } from './source-maps' + +it('should emit source maps', () => { + let map = toSourceMap('{"version":3,"sources":[],"names":[],"mappings":""}') + + expect(map.comment('app.css.map')).toBe('/*# sourceMappingURL=app.css.map */\n') +}) From 29c697898c3c92156a106008b2d0ca028624d3f3 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 12 Mar 2026 11:56:40 +0100 Subject: [PATCH 2/2] replace `=` with `\x3d` This way, vitest (or vite), doesn't get confused when running tests. The test we added for source maps verifies that `\x3d` gets properly converted to an `=` when emitting source maps. --- packages/@tailwindcss-node/src/source-maps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@tailwindcss-node/src/source-maps.ts b/packages/@tailwindcss-node/src/source-maps.ts index 8810b106c5ef..58b79cb253c3 100644 --- a/packages/@tailwindcss-node/src/source-maps.ts +++ b/packages/@tailwindcss-node/src/source-maps.ts @@ -46,7 +46,7 @@ export function toSourceMap(map: DecodedSourceMap | string): SourceMap { let raw = typeof map === 'string' ? map : serializeSourceMap(map) function comment(url: string) { - return `/*# sourceMappingURL=${url} */\n` + return `/*# sourceMappingURL\x3d${url} */\n` } return {