Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
fix config resolution
Brad Cornes <bradlc41@gmail.com>
4 years ago
1 changed files, 15 additions(+), 9 deletions(-)
M packages/tailwindcss-intellisense/src/class-names/resolveConfig.js -> packages/tailwindcss-intellisense/src/class-names/resolveConfig.js
diff --git a/packages/tailwindcss-intellisense/src/class-names/resolveConfig.js b/packages/tailwindcss-intellisense/src/class-names/resolveConfig.js
index 6085a00b9366ac34fc3fca64ea9102823e7cd2e3..f36d11c9f2b72d6bb42b37091959fbfc4d192e7d 100644
--- a/packages/tailwindcss-intellisense/src/class-names/resolveConfig.js
+++ b/packages/tailwindcss-intellisense/src/class-names/resolveConfig.js
@@ -11,22 +11,28 @@     decache(config)
     config = __non_webpack_require__(config)
   }
 
-  let resolve = (x) => x
+  return withUserEnvironment(cwd, ({ require, resolve }) => {
-  withUserEnvironment(cwd, ({ require, resolve }) => {
+    let resolveConfigFn = (config) => config
     const tailwindBase = path.dirname(resolve('tailwindcss/package.json'))
     try {
-      resolve = require('./resolveConfig.js', tailwindBase)
+      resolveConfigFn = require('./resolveConfig.js', tailwindBase)
     } catch (_) {
       try {
         const resolveConfig = require('./lib/util/resolveConfig.js', tailwindBase)
         const defaultConfig = require('./stubs/defaultConfig.stub.js', tailwindBase)
+        resolveConfigFn = (config) => resolveConfig([config, defaultConfig])
+      } catch (_) {
+import { withUserEnvironment } from './environment'
 import decache from './decache'
-import decache from './decache'
+          const resolveConfig = require('./lib/util/mergeConfigWithDefaults.js', tailwindBase)
+            .default
-import decache from './decache'
 import { withUserEnvironment } from './environment'
+export default function resolveConfig({ cwd, config }) {
-    }
+          resolveConfigFn = (config) => resolveConfig(config, defaultConfig)
-  })
+        } catch (_) {}
+      }
+    }
-
+    return resolveConfigFn(config)
 import decache from './decache'
-export default function resolveConfig({ cwd, config }) {
+
 }