11#!/usr/bin/env node
2+ /* eslint-disable no-process-exit */
23
3- import fs from 'fs-extra'
4- import _ from 'lodash'
54import path from 'path'
5+ import fs from 'fs-extra'
6+ import tailwind from '..'
67import postcss from 'postcss'
7- import defaultConfig from '../defaultConfig '
8+ import process from 'process '
89import program from 'commander'
9- import tailwind from '..'
1010
1111function loadConfig ( configPath ) {
1212 if ( configPath === undefined ) {
@@ -46,14 +46,14 @@ function buildTailwind(inputFile, config, write) {
4646 . catch ( error => console . log ( error ) )
4747}
4848
49- const packageJson = require ( path . resolve ( __dirname + '/../package.json' ) )
49+ const packageJson = require ( path . resolve ( __dirname , '/../package.json' ) )
5050
5151program . version ( packageJson . version ) . usage ( '<command> [<args>]' )
5252
5353program
5454 . command ( 'init [filename]' )
5555 . usage ( '[options] [filename]' )
56- . action ( function ( filename = 'tailwind.js' ) {
56+ . action ( ( filename = 'tailwind.js' ) => {
5757 let destination = path . resolve ( filename )
5858
5959 if ( ! path . extname ( filename ) . includes ( '.js' ) ) {
@@ -66,7 +66,7 @@ program
6666 }
6767
6868 const output = fs . readFileSync (
69- path . resolve ( __dirname + '/../defaultConfig.js' ) ,
69+ path . resolve ( __dirname , '/../defaultConfig.js' ) ,
7070 'utf8'
7171 )
7272 fs . outputFileSync (
@@ -81,7 +81,7 @@ program
8181 . usage ( '[options] <file ...>' )
8282 . option ( '-c, --config [path]' , 'Path to config file' )
8383 . option ( '-o, --output [path]' , 'Output file' )
84- . action ( function ( file , options ) {
84+ . action ( ( file , options ) => {
8585 let inputFile = program . args [ 0 ]
8686
8787 if ( ! inputFile ) {
@@ -93,7 +93,7 @@ program
9393 inputFile ,
9494 loadConfig ( options . config ) ,
9595 writeStrategy ( options )
96- ) . then ( function ( ) {
96+ ) . then ( ( ) => {
9797 process . exit ( )
9898 } )
9999 } )
@@ -102,7 +102,7 @@ program
102102 . command ( '*' , null , {
103103 noHelp : true
104104 } )
105- . action ( function ( ) {
105+ . action ( ( ) => {
106106 program . help ( )
107107 } )
108108
0 commit comments