export const env = {
NODE_ENV: process.env.NODE_ENV,
DEBUG: resolveDebug(process.env.DEBUG),
}
export const contextMap = new Map()
export const configContextMap = new Map()
export const contextSourcesMap = new Map()
export const sourceHashMap = new Map()
export const NOT_ON_DEMAND = new String('*')
export function resolveDebug(debug) {
if (debug === undefined) {
return false
}
if (debug === 'true' || debug === '1') {
return true
}
if (debug === 'false' || debug === '0') {
return false
}
if (debug === '*') {
return true
}
let debuggers = debug.split(',').map((d) => d.split(':')[0])
if (debuggers.includes('-tailwindcss')) {
return false
}
if (debuggers.includes('tailwindcss')) {
return true
}
return false
}