Skip to content

Commit decb9e6

Browse files
committed
Remove __tw_readFile hack
Async APIs became capable of reading embedded files in Bun v1.2.3
1 parent ecd590b commit decb9e6

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

packages/@tailwindcss-node/src/compile.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,6 @@ async function loadStylesheet(
166166

167167
onDependency(resolvedPath)
168168

169-
if (typeof globalThis.__tw_readFile === 'function') {
170-
let file = await globalThis.__tw_readFile(resolvedPath, 'utf-8')
171-
if (file) {
172-
return {
173-
path: resolvedPath,
174-
base: path.dirname(resolvedPath),
175-
content: file,
176-
}
177-
}
178-
}
179-
180169
let file = await fsPromises.readFile(resolvedPath, 'utf-8')
181170
return {
182171
path: resolvedPath,

packages/@tailwindcss-standalone/src/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fs from 'node:fs'
21
import { createRequire } from 'node:module'
32
import packageJson from 'tailwindcss/package.json'
43

@@ -61,15 +60,6 @@ globalThis.__tw_load = async (id) => {
6160
}
6261
}
6362
globalThis.__tw_version = packageJson.version
64-
globalThis.__tw_readFile = async (path, encoding) => {
65-
// When reading a file from the `$bunfs`, we need to use the synchronous
66-
// `readFileSync` API
67-
let isEmbeddedFileBase = path.includes('/$bunfs/root') || path.includes(':/~BUN/root')
68-
if (!isEmbeddedFileBase) {
69-
return
70-
}
71-
return fs.readFileSync(path, encoding)
72-
}
7363

7464
// We use a plugin to make sure that the JS APIs are bundled with the standalone
7565
// CLI and can be imported inside configs and plugins

0 commit comments

Comments
 (0)