Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
avoid re-loading modules when not necessary
Brad Cornes <bradlc41@gmail.com>
3 years ago
1 changed files, 10 additions(+), 9 deletions(-)
M src/server.ts -> src/server.ts
diff --git a/src/server.ts b/src/server.ts
index 8ff0e722cb69f52c3ef8f02d1a27b75cb5c3c33b..0a928f527f0cadbe8419bef46fd8e648818a989e 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -317,8 +317,6 @@     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')
@@ -359,7 +357,6 @@
     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')
@@ -367,13 +364,8 @@       const postcssPkgPath = resolveFrom(tailwindDir, 'postcss/package.json')
       const postcssDir = path.dirname(postcssPkgPath)
       const postcssSelectorParserPath = resolveFrom(tailwindDir, 'postcss-selector-parser')
 
-      postcss = __non_webpack_require__(postcssPath)
       postcssVersion = __non_webpack_require__(postcssPkgPath).version
-      postcssSelectorParser = __non_webpack_require__(postcssSelectorParserPath)
-      console.log(`Loaded postcss v${postcssVersion}: ${postcssDir}`)
-      tailwindcss = __non_webpack_require__(tailwindcssPath)
-      tailwindcssVersion = tailwindcssPkg.version
-      console.log(`Loaded tailwindcss v${tailwindcssVersion}: ${tailwindDir}`)
+      tailwindcssVersion = __non_webpack_require__(tailwindcssPkgPath).version
 
       if (
         state.enabled &&
@@ -384,6 +376,15 @@         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'))