Fix stuff

This commit is contained in:
Jordan Pittman 2023-06-14 13:43:44 -04:00 • committed by Robin Malfait
parent 971253b1cf
commit 7573cc7d2a
No known key found for this signature in database
GPG key ID: 92F53D68B9041AFE

View file

@ -28,7 +28,7 @@ function getCandidateFiles(context, tailwindConfig) {
}
// Get the config object based on a path
function getTailwindConfig(configOrPath, cssThemeValues) {
function getTailwindConfig(configOrPath, cssThemeValues = {}) {
let userConfigPath = resolveConfigPath(configOrPath)
if (userConfigPath !== null) {
@ -57,7 +57,7 @@ function getTailwindConfig(configOrPath, cssThemeValues) {
delete require.cache[file]
}
let newConfig = validateConfig(
resolveConfig({ theme: cssThemeValues }, loadConfig(userConfigPath))
resolveConfig(loadConfig(userConfigPath), { theme: cssThemeValues })
)
let newHash = hash(newConfig)
configPathCache.set(userConfigPath, [newConfig, newHash, newDeps, newModified])
@ -66,8 +66,8 @@ function getTailwindConfig(configOrPath, cssThemeValues) {
// It's a plain object, not a path
let newConfig = resolveConfig(
{ theme: cssThemeValues },
configOrPath?.config ?? configOrPath ?? {}
configOrPath?.config ?? configOrPath ?? {},
{ theme: cssThemeValues }
)
newConfig = validateConfig(newConfig)