diff --git a/build.mjs b/build.mjs index cea4f73..313b4f0 100644 --- a/build.mjs +++ b/build.mjs @@ -132,7 +132,7 @@ let context = await esbuild.context({ bundle: true, platform: 'node', target: 'node14.21.3', - external: ['prettier'], + external: ['prettier', 'oxc-resolver'], minify: process.argv.includes('--minify'), entryPoints: [path.resolve(__dirname, './src/index.js')], outfile: path.resolve(__dirname, './dist/index.mjs'), diff --git a/package-lock.json b/package-lock.json index a428ba5..c74d255 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "prettier-plugin-tailwindcss", "version": "0.7.2", "license": "MIT", + "dependencies": { + "oxc-resolver": "^11.16.0" + }, "devDependencies": { "@babel/types": "^7.28.2", "@ianvs/prettier-plugin-sort-imports": "^4.7.0", @@ -23,7 +26,6 @@ "clear-module": "^4.1.2", "cpy-cli": "^6.0.0", "dedent": "^1.6.0", - "enhanced-resolve": "^5.18.3", "esbuild": "^0.25.9", "escalade": "^3.2.0", "import-sort-style-module": "^6.0.0", @@ -689,7 +691,6 @@ "version": "1.7.1", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz", "integrity": "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -701,7 +702,6 @@ "version": "1.7.1", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -712,7 +712,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -1732,6 +1731,281 @@ "url": "https://github.com/sponsors/Boshen" } }, + "node_modules/@oxc-resolver/binding-android-arm-eabi": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.16.0.tgz", + "integrity": "sha512-/kFX4o8KISHCZzHRs8fBp/wZOPdkhYGquhMP2PQjc8ePAVbtaXXDPAFkjUKhz2jXNPS4jGA1wNW+8grhnJgstw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-android-arm64": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.16.0.tgz", + "integrity": "sha512-kPySx7j7mPxW4mRDrdbADyzJV2XrxVeMPDmNnFvTt0/LT1IA26Uk9hzWKQb4k4aeJY58bnRY1soYSawW5wAlKQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.16.0.tgz", + "integrity": "sha512-eB00fkys5TX6oI3lY+1hgHl6dwfmrbhHTmInmJmfD6BysHpE+DUqSdQIRS2v5NI6+j+J9EWBmbW3hRtolr+MSg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.16.0.tgz", + "integrity": "sha512-B/yMSxqe4MZfh/VoMax0qixl4XxG/sAQVlYtdVGNteBAYKfX/uw2mglkYsApk6D4qD6fVgJ21RwI50lV7oD0Qg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.16.0.tgz", + "integrity": "sha512-aKj+PNsSdn0owueMt/6TtR8QuLBNL/q2HgMdN8nRCDmoCBPvQlwB2s+AcW+UW1vyiok+9qiI5tVjihbKwQ+Khg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.16.0.tgz", + "integrity": "sha512-fxod0D0eMsIlGF98KRAwR3zjLCbpRoknDHjCHx22A9TmyQthGo7t66gwkRCj5g2LBbpaPZ+i6cYd2l9bRrx8+Q==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.16.0.tgz", + "integrity": "sha512-5BoVnD0hpEID/13hnj0fCIojE26wfa9p4puCnm12/D5BhGlXA103n8iRaPZPLHS/prQGtrwMiFONiysD6vmIBA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.16.0.tgz", + "integrity": "sha512-dMoKX6A8iuIdShbc4PB/+q6Tx8grgQxNAJQfIAmpaDTZp5NxfgzKrssPL0TCdu3RQMblF8yfXLYUFnOdPYZeRg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.16.0.tgz", + "integrity": "sha512-oLJsyqVHw53ZZPl3+wPiRNXTvavBFSInRYBB5MaNf+y42+b4XJfH7hVYyc67er0c26cQUCfx2KzqltSx7Jg9jg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.16.0.tgz", + "integrity": "sha512-qL7GsXwyytVTIh/o8cLftRYvzrpniD8pFf0jDW3VXlVsl1joCrb4GM26udGls7Zxe76nsZpPvQVB5eZ9xmHxIA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.16.0.tgz", + "integrity": "sha512-CFJEvagoakxPtIoKtRgPoGUqeXSgd63c3/T9hOXrgelOaMv6aEWFfjvc/4Lk5ppk2wv4KeK4IqOKBe8Faqv1Mw==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.16.0.tgz", + "integrity": "sha512-LVuE2tbZ7gjEjY1G8mjf7+pacj0/Rge9EoHxr8DY2gAxxy0qXe5Yh2Qxe3dwwFGObVNioqRH0IPkePmQ/KJK6w==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.16.0.tgz", + "integrity": "sha512-D4Zk48WN7sKsbyq4xD2F09U4S0sIkHXTW9A33BaqjfNXOD/jFXM5nTPahHx2RxBLo5ZEgS3kUW1U8V0oCBcPcg==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.16.0.tgz", + "integrity": "sha512-WyqsQwz+x1lDe/rwf5pl/FiTiS4eEM7hEHn1OwjP+EThzXXBup9BeZE5QVB421QGm9n4SyJT1gJgI1LCRvqbaA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.16.0.tgz", + "integrity": "sha512-5XCuIoviaMsiAAuaQL4HqnYj1BkADcbtdf2s6Ru4YHF3P/bt2p05hd4xVo85cFT1VXlGYL66XVfepsAGymJs0g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-openharmony-arm64": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.16.0.tgz", + "integrity": "sha512-gn54HKxOhWTxZG8pNeBMmbRwHT4k/eIf0KxBII2oHUrSTinNTcqu6xn1etqt1Yezi9KzJzkTMS0cl5kTFmCHUQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.16.0.tgz", + "integrity": "sha512-dUsUjffSI7nlt+TH9C4gGqmD/kNyx3Kghh8u+i8eZZAEFWDO+s51Yw3UADDa0BYrZDeaLjz8rgHWCE8lxpL2XQ==", + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.0.tgz", + "integrity": "sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@tybys/wasm-util": "^0.10.1" + } + }, + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.16.0.tgz", + "integrity": "sha512-6EhsnwzA6iT752sU5tv/r+XI5cz6sWUPHJZu3brTW3m96j6yCZ8vnfeKAkFCzuDwZAXOkRLPW8WKrL0GXWfCUQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-ia32-msvc": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.16.0.tgz", + "integrity": "sha512-YpUXuKrslGs4+In1gZhY25menhzyBbMct4RvWT9je6mYA5VCQ6aGAZf/ky5b+5sNPpR2UBNbCcYk5pP/6MowMw==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.16.0.tgz", + "integrity": "sha512-x3hU0m0c/+frUSFaw3r5Xmde5q/PdsAfznh+8lZloGK2/qfIze0jyQG0H5M6AgrUIQE1oNn8vdGXanza5+naMw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -2307,7 +2581,6 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -3407,20 +3680,6 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, - "node_modules/enhanced-resolve": { - "version": "5.18.3", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", - "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/error-stack-parser": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", @@ -5199,6 +5458,37 @@ "@oxc-parser/binding-win32-x64-msvc": "0.99.0" } }, + "node_modules/oxc-resolver": { + "version": "11.16.0", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.16.0.tgz", + "integrity": "sha512-I4sHGa1fZUpTQ9ftS0E0cBYbBjNnIKXRSX/trFMIJDIJ4n21dCrLAZhnJS0TSfRIRqZNFyceNZr2kablfgNyTA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-resolver/binding-android-arm-eabi": "11.16.0", + "@oxc-resolver/binding-android-arm64": "11.16.0", + "@oxc-resolver/binding-darwin-arm64": "11.16.0", + "@oxc-resolver/binding-darwin-x64": "11.16.0", + "@oxc-resolver/binding-freebsd-x64": "11.16.0", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.16.0", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.16.0", + "@oxc-resolver/binding-linux-arm64-gnu": "11.16.0", + "@oxc-resolver/binding-linux-arm64-musl": "11.16.0", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.16.0", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.16.0", + "@oxc-resolver/binding-linux-riscv64-musl": "11.16.0", + "@oxc-resolver/binding-linux-s390x-gnu": "11.16.0", + "@oxc-resolver/binding-linux-x64-gnu": "11.16.0", + "@oxc-resolver/binding-linux-x64-musl": "11.16.0", + "@oxc-resolver/binding-openharmony-arm64": "11.16.0", + "@oxc-resolver/binding-wasm32-wasi": "11.16.0", + "@oxc-resolver/binding-win32-arm64-msvc": "11.16.0", + "@oxc-resolver/binding-win32-ia32-msvc": "11.16.0", + "@oxc-resolver/binding-win32-x64-msvc": "11.16.0" + } + }, "node_modules/p-event": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/p-event/-/p-event-6.0.1.tgz", @@ -6724,15 +7014,6 @@ "dev": true, "license": "MIT" }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -6891,7 +7172,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true + "devOptional": true }, "node_modules/tsup": { "version": "8.5.0", diff --git a/package.json b/package.json index bab476a..42a60ae 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,9 @@ "release-channel": "node ./scripts/release-channel.js", "release-notes": "node ./scripts/release-notes.js" }, + "dependencies": { + "oxc-resolver": "^11.16.0" + }, "devDependencies": { "@babel/types": "^7.28.2", "@ianvs/prettier-plugin-sort-imports": "^4.7.0", @@ -47,7 +50,6 @@ "clear-module": "^4.1.2", "cpy-cli": "^6.0.0", "dedent": "^1.6.0", - "enhanced-resolve": "^5.18.3", "esbuild": "^0.25.9", "escalade": "^3.2.0", "import-sort-style-module": "^6.0.0", @@ -72,8 +74,8 @@ "resolve-from": "^5.0.0", "rimraf": "^6.0.1", "svelte": "^5.38.2", - "tailwindcss-v4": "npm:tailwindcss@^4.1.14", "tailwindcss-v3": "npm:tailwindcss@^3.4.18", + "tailwindcss-v4": "npm:tailwindcss@^4.1.14", "tsup": "^8.5.0", "vitest": "^3.2.4" }, diff --git a/src/resolve.ts b/src/resolve.ts index e106914..3a6c669 100644 --- a/src/resolve.ts +++ b/src/resolve.ts @@ -1,29 +1,24 @@ import fs from 'node:fs' import { fileURLToPath } from 'node:url' -import { CachedInputFileSystem, ResolverFactory } from 'enhanced-resolve' +import { ResolverFactory } from 'oxc-resolver' import { expiringMap } from './expiring-map' -const fileSystem = new CachedInputFileSystem(fs, 30_000) - -const esmResolver = ResolverFactory.createResolver({ - fileSystem, - useSyncFileSystemCalls: true, +const esmResolver = new ResolverFactory({ + tsconfig: 'auto', extensions: ['.mjs', '.js'], mainFields: ['module'], conditionNames: ['node', 'import'], }) -const cjsResolver = ResolverFactory.createResolver({ - fileSystem, - useSyncFileSystemCalls: true, +const cjsResolver = esmResolver.cloneWithOptions({ + tsconfig: 'auto', extensions: ['.js', '.cjs'], mainFields: ['main'], conditionNames: ['node', 'require'], }) -const cssResolver = ResolverFactory.createResolver({ - fileSystem, - useSyncFileSystemCalls: true, +const cssResolver = esmResolver.cloneWithOptions({ + tsconfig: 'auto', extensions: ['.css'], mainFields: ['style'], conditionNames: ['style'], @@ -64,13 +59,9 @@ export async function loadIfExists(name: string): Promise { } export function resolveJsFrom(base: string, id: string): string { - try { - return esmResolver.resolveSync({}, base, id) || id - } catch (err) { - return cjsResolver.resolveSync({}, base, id) || id - } + return esmResolver.sync(base, id).path ?? cjsResolver.sync(base, id).path ?? id } export function resolveCssFrom(base: string, id: string) { - return cssResolver.resolveSync({}, base, id) || id + return cssResolver.sync(base, id).path ?? id } diff --git a/tests/fixtures.test.ts b/tests/fixtures.test.ts index e810a39..5ef5123 100644 --- a/tests/fixtures.test.ts +++ b/tests/fixtures.test.ts @@ -87,6 +87,11 @@ let fixtures = [ dir: 'v4/subpath-imports', ext: 'html', }, + { + name: 'v4: tsconfig imports', + dir: 'v4/tsconfig-imports', + ext: 'html', + }, { name: 'custom npm package name: v3', dir: 'custom-pkg-name-v3', diff --git a/tests/fixtures/v4/tsconfig-imports/app.css b/tests/fixtures/v4/tsconfig-imports/app.css new file mode 100644 index 0000000..c57e614 --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/app.css @@ -0,0 +1,2 @@ +@import 'tailwindcss'; +@import '#theme'; diff --git a/tests/fixtures/v4/tsconfig-imports/index.html b/tests/fixtures/v4/tsconfig-imports/index.html new file mode 100644 index 0000000..f7a7609 --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/index.html @@ -0,0 +1 @@ +
diff --git a/tests/fixtures/v4/tsconfig-imports/output.html b/tests/fixtures/v4/tsconfig-imports/output.html new file mode 100644 index 0000000..8409de1 --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/output.html @@ -0,0 +1 @@ +
diff --git a/tests/fixtures/v4/tsconfig-imports/package-lock.json b/tests/fixtures/v4/tsconfig-imports/package-lock.json new file mode 100644 index 0000000..5edff76 --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/package-lock.json @@ -0,0 +1,18 @@ +{ + "name": "tsconfig-imports", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "tailwindcss": "^4.0.0" + } + }, + "node_modules/tailwindcss": { + "version": "4.1.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz", + "integrity": "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==", + "license": "MIT" + } + } +} diff --git a/tests/fixtures/v4/tsconfig-imports/package.json b/tests/fixtures/v4/tsconfig-imports/package.json new file mode 100644 index 0000000..fd0174c --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "tailwindcss": "^4.0.0" + }, + "prettier": { + "tailwindStylesheet": "./app.css" + } +} diff --git a/tests/fixtures/v4/tsconfig-imports/theme.css b/tests/fixtures/v4/tsconfig-imports/theme.css new file mode 100644 index 0000000..af1fa29 --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/theme.css @@ -0,0 +1,3 @@ +@theme { + --color-tomato: tomato; +} diff --git a/tests/fixtures/v4/tsconfig-imports/tsconfig.json b/tests/fixtures/v4/tsconfig-imports/tsconfig.json new file mode 100644 index 0000000..ff9c378 --- /dev/null +++ b/tests/fixtures/v4/tsconfig-imports/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "paths": { + "#theme": ["./theme.css"] + } + } +}