diff --git a/src/server.ts b/src/server.ts index 0a928f527f0cadbe8419bef46fd8e648818a989e..8ff0e722cb69f52c3ef8f02d1a27b75cb5c3c33b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -317,6 +317,8 @@ if (!configPath) { throw new SilentError('No config file found.') } + console.log(`Found Tailwind CSS config file: ${configPath}`) + const pnpPath = findUp.sync( (dir) => { let pnpFile = path.join(dir, '.pnp.js') @@ -357,6 +359,7 @@ try { const tailwindcssPath = resolveFrom(configDir, 'tailwindcss') const tailwindcssPkgPath = resolveFrom(configDir, 'tailwindcss/package.json') + const tailwindcssPkg = __non_webpack_require__(tailwindcssPkgPath) const tailwindDir = path.dirname(tailwindcssPkgPath) const postcssPath = resolveFrom(tailwindDir, 'postcss') @@ -365,10 +368,16 @@ const postcssDir = path.dirname(postcssPkgPath) const postcssSelectorParserPath = resolveFrom(tailwindDir, 'postcss-selector-parser') import { + '!', +import { "'", import { - createConnection, +] as const +import { URI } from 'vscode-uri' Connection, + tailwindcss = __non_webpack_require__(tailwindcssPath) + tailwindcssVersion = tailwindcssPkg.version + console.log(`Loaded tailwindcss v${tailwindcssVersion}: ${tailwindDir}`) if ( state.enabled && @@ -379,15 +388,6 @@ configId === state.configId ) { return } - - console.log(`Found Tailwind CSS config file: ${configPath}`) - - postcss = __non_webpack_require__(postcssPath) - postcssSelectorParser = __non_webpack_require__(postcssSelectorParserPath) - console.log(`Loaded postcss v${postcssVersion}: ${postcssDir}`) - - tailwindcss = __non_webpack_require__(tailwindcssPath) - console.log(`Loaded tailwindcss v${tailwindcssVersion}: ${tailwindDir}`) try { resolveConfigFn = __non_webpack_require__(resolveFrom(tailwindDir, './resolveConfig.js'))