tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/packages/tailwindcss-class-names/src/index.js b/packages/tailwindcss-class-names/src/index.js
index a0501526fafec7c40356e7d65776fe4623b6ec3e..2d852e87a3ad461f768dcdb05ebce256ad735119 100644
--- a/packages/tailwindcss-class-names/src/index.js
+++ b/packages/tailwindcss-class-names/src/index.js
@@ -10,6 +10,7 @@ import getPlugins from './getPlugins'
import getVariants from './getVariants'
import resolveConfig from './resolveConfig'
import * as util from 'util'
+import * as path from 'path'
import { glob } from './glob'
import { getUtilityConfigMap } from './getUtilityConfigMap'
@@ -51,9 +52,10 @@ max: 1,
})
invariant(configPath.length === 1, 'No Tailwind CSS config found.')
configPath = configPath[0]
- postcss = importFrom(cwd, 'postcss')
- tailwindcss = importFrom(cwd, 'tailwindcss')
- version = importFrom(cwd, 'tailwindcss/package.json').version
+ const configDir = path.dirname(configPath)
+ postcss = importFrom(configDir, 'postcss')
+ tailwindcss = importFrom(configDir, 'tailwindcss')
+ version = importFrom(configDir, 'tailwindcss/package.json').version
const sepLocation = semver.gte(version, '0.99.0')
? ['separator']
@@ -90,7 +92,7 @@ } else {
delete config[sepLocation]
}
- const resolvedConfig = resolveConfig({ cwd, config })
+ const resolvedConfig = resolveConfig({ cwd: configDir, config })
return {
version,
@@ -102,7 +104,7 @@ dependencies: hook.deps,
plugins: getPlugins(config),
variants: getVariants({ config, version, postcss }),
utilityConfigMap: await getUtilityConfigMap({
- cwd,
+ cwd: configDir,
resolvedConfig,
postcss,
}),