Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
only run browserslist once
Brad Cornes <brad@parall.ax>
4 years ago
2 changed files, 8 additions(+), 3 deletions(-)
M src/class-names/index.js -> src/class-names/index.js
diff --git a/src/class-names/index.js b/src/class-names/index.js
index 2aaec68aa35f27c932ca91020de137f49919ecce..1e2d3e5fd54fe7bf1452d8893f155532686fa118 100644
--- a/src/class-names/index.js
+++ b/src/class-names/index.js
@@ -43,7 +43,7 @@   async function run() {
     let configPath
     let postcss
     let tailwindcss
-    let browserslist
+    let browserslistModule
     let version
 
     configPath = await globSingle(CONFIG_GLOB, {
@@ -61,7 +61,7 @@     version = importFrom(configDir, 'tailwindcss/package.json').version
 
     try {
       // this is not required
-      browserslist = importFrom(configDir, 'browserslist')
+      browserslistModule = importFrom(configDir, 'browserslist')
     } catch (_) {}
 
     const sepLocation = semver.gte(version, '0.99.0')
@@ -100,6 +100,11 @@       delete config[sepLocation]
     }
 
     const resolvedConfig = resolveConfig({ cwd: configDir, config })
+    const browserslist = browserslistModule
+      ? browserslistModule(undefined, {
+          path: configDir,
+        })
+      : []
 
     return {
       version,
M src/class-names/runPlugin.js -> src/class-names/runPlugin.js
diff --git a/src/class-names/runPlugin.js b/src/class-names/runPlugin.js
index c53f4ce74fa63450f2c747841b71f7062708d8f2..dbdd2b5d9fe213987d842f7bd44223d2ee9bb490 100644
--- a/src/class-names/runPlugin.js
+++ b/src/class-names/runPlugin.js
@@ -4,7 +4,7 @@ export function runPlugin(plugin, params = {}) {
   const { config, browserslist, ...rest } = params
 
   const browserslistTarget =
-    browserslist && browserslist().includes('ie 11') ? 'ie11' : 'relaxed'
+    browserslist && browserslist.includes('ie 11') ? 'ie11' : 'relaxed'
 
   try {
     ;(plugin.handler || plugin)({