@@ -8,19 +8,6 @@ import postcss from 'postcss'
8
8
import process from 'process'
9
9
import program from 'commander'
10
10
11
- function loadConfig ( configPath ) {
12
- if ( configPath === undefined ) {
13
- return undefined
14
- }
15
-
16
- if ( ! fs . existsSync ( path . resolve ( configPath ) ) ) {
17
- console . error ( `Config file [${ configPath } ] does not exist.` )
18
- process . exit ( 1 )
19
- }
20
-
21
- return require ( path . resolve ( configPath ) )
22
- }
23
-
24
11
function writeStrategy ( options ) {
25
12
if ( options . output === undefined ) {
26
13
return output => {
@@ -46,7 +33,7 @@ function buildTailwind(inputFile, config, write) {
46
33
. catch ( error => console . log ( error ) )
47
34
}
48
35
49
- const packageJson = require ( path . resolve ( __dirname , '/ ../package.json' ) )
36
+ const packageJson = require ( path . resolve ( __dirname , '../package.json' ) )
50
37
51
38
program . version ( packageJson . version ) . usage ( '<command> [<args>]' )
52
39
@@ -65,7 +52,7 @@ program
65
52
process . exit ( 1 )
66
53
}
67
54
68
- const output = fs . readFileSync ( path . resolve ( __dirname , '/ ../defaultConfig.js' ) , 'utf8' )
55
+ const output = fs . readFileSync ( path . resolve ( __dirname , '../defaultConfig.js' ) , 'utf8' )
69
56
fs . outputFileSync ( destination , output . replace ( '// var defaultConfig' , 'var defaultConfig' ) )
70
57
process . exit ( )
71
58
} )
@@ -83,7 +70,7 @@ program
83
70
process . exit ( 1 )
84
71
}
85
72
86
- buildTailwind ( inputFile , loadConfig ( options . config ) , writeStrategy ( options ) ) . then ( ( ) => {
73
+ buildTailwind ( inputFile , options . config , writeStrategy ( options ) ) . then ( ( ) => {
87
74
process . exit ( )
88
75
} )
89
76
} )
0 commit comments