Skip to content

Commit 06576ba

Browse files
committed
Remove sucrase
1 parent 7e2dd53 commit 06576ba

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
"postcss-load-config": "^4.0.2 || ^5.0 || ^6.0",
8585
"postcss-nested": "^6.2.0",
8686
"postcss-selector-parser": "^6.1.2",
87-
"resolve": "^1.22.8",
88-
"sucrase": "^3.35.0"
87+
"resolve": "^1.22.8"
8988
},
9089
"browserslist": [
9190
"> 1%",

src/lib/load-config.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import jitiFactory from 'jiti'
2-
import { transform } from 'sucrase'
32

43
import { Config } from '../../types/config'
54

@@ -17,16 +16,7 @@ function lazyJiti() {
1716
jiti ??
1817
(jiti = jitiFactory(__filename, {
1918
interopDefault: true,
20-
transform: (opts) => {
21-
// Sucrase can't transform import.meta so we have to use Babel
22-
if (opts.source.includes('import.meta')) {
23-
return require('jiti/dist/babel.js')(opts)
24-
}
25-
26-
return transform(opts.source, {
27-
transforms: ['typescript', 'imports'],
28-
})
29-
},
19+
transform: (opts) => require('jiti/dist/babel.js')(opts),
3020
}))
3121
)
3222
}

standalone-cli/standalone.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,12 @@ let localModules = {
3131
// Swap out the default JITI implementation with one that has the built-in modules above preloaded as "native modules"
3232
// NOTE: This uses a private, internal API of Tailwind CSS and is subject to change at any time
3333
let { useCustomJiti } = require('tailwindcss/lib/lib/load-config')
34-
let { transform } = require('sucrase')
3534

3635
useCustomJiti(() =>
3736
require('jiti')(__filename, {
3837
interopDefault: true,
3938
nativeModules: Object.keys(localModules),
40-
transform: (opts) => {
41-
// Sucrase can't transform import.meta so we have to use Babel
42-
if (opts.source.includes('import.meta')) {
43-
return require('jiti/dist/babel.js')(opts)
44-
}
45-
46-
return transform(opts.source, {
47-
transforms: ['typescript', 'imports'],
48-
})
49-
},
39+
transform: (opts) => require('jiti/dist/babel.js')(opts),
5040
})
5141
)
5242

0 commit comments

Comments
 (0)