File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
packages/tailwindcss-language-server/src Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,19 @@ import preflight from 'tailwindcss/lib/css/preflight.css'
84
84
85
85
// @ts -ignore
86
86
global . __preflight = preflight
87
- eval ( `
88
- let oldReadFileSync = require('fs').readFileSync
89
- require('fs').readFileSync = function (filename, ...args) {
90
- if (filename === require('path').join(__dirname, 'css/preflight.css')) {
91
- return global.__preflight
87
+ new Function (
88
+ 'require' ,
89
+ '__dirname' ,
90
+ `
91
+ let oldReadFileSync = require('fs').readFileSync
92
+ require('fs').readFileSync = function (filename, ...args) {
93
+ if (filename === require('path').join(__dirname, 'css/preflight.css')) {
94
+ return global.__preflight
95
+ }
96
+ return oldReadFileSync(filename, ...args)
92
97
}
93
- return oldReadFileSync(filename, ...args)
94
- }
95
- ` )
98
+ `
99
+ ) ( require , __dirname )
96
100
97
101
const CONFIG_FILE_GLOB = '{tailwind,tailwind.config}.{js,cjs}'
98
102
const PACKAGE_GLOB = '{package.json,package-lock.json,yarn.lock,pnpm-lock.yaml}'
You can’t perform that action at this time.
0 commit comments