@@ -8,19 +8,6 @@ import postcss from 'postcss'
88import process from 'process'
99import program from 'commander'
1010
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-
2411function writeStrategy ( options ) {
2512 if ( options . output === undefined ) {
2613 return output => {
@@ -46,7 +33,7 @@ function buildTailwind(inputFile, config, write) {
4633 . catch ( error => console . log ( error ) )
4734}
4835
49- const packageJson = require ( path . resolve ( __dirname , '/ ../package.json' ) )
36+ const packageJson = require ( path . resolve ( __dirname , '../package.json' ) )
5037
5138program . version ( packageJson . version ) . usage ( '<command> [<args>]' )
5239
@@ -65,7 +52,7 @@ program
6552 process . exit ( 1 )
6653 }
6754
68- const output = fs . readFileSync ( path . resolve ( __dirname , '/ ../defaultConfig.js' ) , 'utf8' )
55+ const output = fs . readFileSync ( path . resolve ( __dirname , '../defaultConfig.js' ) , 'utf8' )
6956 fs . outputFileSync ( destination , output . replace ( '// var defaultConfig' , 'var defaultConfig' ) )
7057 process . exit ( )
7158 } )
@@ -83,7 +70,7 @@ program
8370 process . exit ( 1 )
8471 }
8572
86- buildTailwind ( inputFile , loadConfig ( options . config ) , writeStrategy ( options ) ) . then ( ( ) => {
73+ buildTailwind ( inputFile , options . config , writeStrategy ( options ) ) . then ( ( ) => {
8774 process . exit ( )
8875 } )
8976 } )
0 commit comments