Skip to content

Commit

Permalink
cleanup path.resolve calls
Browse files Browse the repository at this point in the history
path.resolve('.') is the same as path.resolve(process.cwd(), '.')
  • Loading branch information
RobinMalfait committed Jun 1, 2021
1 parent 7b1c37c commit 4d0ed34
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cli.js
Expand Up @@ -91,7 +91,7 @@ if (args['_'].includes('init')) {
}

function init() {
let tailwindConfigLocation = path.resolve(process.cwd(), 'tailwind.config.js')
let tailwindConfigLocation = path.resolve('./tailwind.config.js')
if (fs.existsSync(tailwindConfigLocation)) {
console.log('tailwind.config.js already exists.')
} else {
Expand Down Expand Up @@ -120,7 +120,7 @@ function init() {
}

if (args['--postcss']) {
let postcssConfigLocation = path.resolve(process.cwd(), 'postcss.config.js')
let postcssConfigLocation = path.resolve('./postcss.config.js')
if (fs.existsSync(postcssConfigLocation)) {
console.log('postcss.config.js already exists.')
} else {
Expand Down Expand Up @@ -195,7 +195,7 @@ function build() {

for (let file of files) {
changedContent.push({
content: fs.readFileSync(path.resolve(process.cwd(), file), 'utf8'),
content: fs.readFileSync(path.resolve(file), 'utf8'),
extension: path.extname(file),
})
}
Expand Down Expand Up @@ -255,7 +255,7 @@ function build() {
}

let css = input
? fs.readFileSync(path.resolve(process.cwd(), input), 'utf8')
? fs.readFileSync(path.resolve(input), 'utf8')
: '@tailwind base; @tailwind components; @tailwind utilities'
return processCSS(css)
}
Expand Down Expand Up @@ -350,7 +350,7 @@ function build() {
}

let css = input
? fs.readFileSync(path.resolve(process.cwd(), input), 'utf8')
? fs.readFileSync(path.resolve(input), 'utf8')
: '@tailwind base; @tailwind components; @tailwind utilities'
let result = await processCSS(css)
env.DEBUG && console.timeEnd('Finished in')
Expand All @@ -361,7 +361,7 @@ function build() {
let config = refreshConfig(configPath)

if (input) {
contextDependencies.add(path.resolve(process.cwd(), input))
contextDependencies.add(path.resolve(input))
}

watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], {
Expand Down Expand Up @@ -390,7 +390,7 @@ function build() {
} else {
chain = chain.then(async () => {
changedContent.push({
content: fs.readFileSync(path.resolve(process.cwd(), file), 'utf8'),
content: fs.readFileSync(path.resolve(file), 'utf8'),
extension: path.extname(file),
})

Expand All @@ -402,7 +402,7 @@ function build() {
watcher.on('add', async (file) => {
chain = chain.then(async () => {
changedContent.push({
content: fs.readFileSync(path.resolve(process.cwd(), file), 'utf8'),
content: fs.readFileSync(path.resolve(file), 'utf8'),
extension: path.extname(file),
})

Expand Down

0 comments on commit 4d0ed34

Please sign in to comment.