Fix initialisation when using `tailwindcss@^0` (#787)

master
Brad Cornes 2023-05-25 10:35:21 +01:00 committed by GitHub
parent 35b9d115bb
commit 4d0623ede0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -668,7 +668,7 @@ async function createProjectService(
'./lib/util/mergeConfigWithDefaults.js' './lib/util/mergeConfigWithDefaults.js'
)) ))
const defaultConfig = require(resolveFrom(tailwindDir, './defaultConfig.js')) const defaultConfig = require(resolveFrom(tailwindDir, './defaultConfig.js'))
resolveConfigFn = (config) => resolveConfig(config, defaultConfig()) resolveConfigFn = (config) => resolveConfig.default(config, defaultConfig())
} catch (_) { } catch (_) {
throw Error('Failed to load resolveConfig function.') throw Error('Failed to load resolveConfig function.')
} }
@ -1029,7 +1029,10 @@ async function createProjectService(
try { try {
state.config = resolveConfig.module(originalConfig) state.config = resolveConfig.module(originalConfig)
state.separator = state.config.separator state.separator = dlv(state.config, sepLocation)
if (typeof state.separator !== 'string') {
state.separator = ':'
}
state.blocklist = Array.isArray(state.config.blocklist) ? state.config.blocklist : [] state.blocklist = Array.isArray(state.config.blocklist) ? state.config.blocklist : []
delete state.config.blocklist delete state.config.blocklist