source: frontend/node_modules/tailwindcss/src/lib/sharedState.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[9af201e]1export const env =
2 typeof process !== 'undefined'
3 ? {
4 NODE_ENV: process.env.NODE_ENV,
5 DEBUG: resolveDebug(process.env.DEBUG),
6 }
7 : {
8 NODE_ENV: 'production',
9 DEBUG: false,
10 }
11
12export const contextMap = new Map()
13export const configContextMap = new Map()
14export const contextSourcesMap = new Map()
15export const sourceHashMap = new Map()
16export const NOT_ON_DEMAND = new String('*')
17
18export const NONE = Symbol('__NONE__')
19
20export function resolveDebug(debug) {
21 if (debug === undefined) {
22 return false
23 }
24
25 // Environment variables are strings, so convert to boolean
26 if (debug === 'true' || debug === '1') {
27 return true
28 }
29
30 if (debug === 'false' || debug === '0') {
31 return false
32 }
33
34 // Keep the debug convention into account:
35 // DEBUG=* -> This enables all debug modes
36 // DEBUG=projectA,projectB,projectC -> This enables debug for projectA, projectB and projectC
37 // DEBUG=projectA:* -> This enables all debug modes for projectA (if you have sub-types)
38 // DEBUG=projectA,-projectB -> This enables debug for projectA and explicitly disables it for projectB
39
40 if (debug === '*') {
41 return true
42 }
43
44 let debuggers = debug.split(',').map((d) => d.split(':')[0])
45
46 // Ignoring tailwindcss
47 if (debuggers.includes('-tailwindcss')) {
48 return false
49 }
50
51 // Including tailwindcss
52 if (debuggers.includes('tailwindcss')) {
53 return true
54 }
55
56 return false
57}
Note: See TracBrowser for help on using the repository browser.