ng-tailwindcss
Advanced tools
Comparing version 2.2.0 to 2.2.1-beta.0
@@ -51,11 +51,11 @@ #!/usr/bin/env node | ||
if (args.config) { | ||
ngTwConfig.configJS = path.normalize(path.resolve(args.config)) | ||
ngTwConfig.configJS = path.normalize(args.config) | ||
} | ||
if (args.source) { | ||
ngTwConfig.sourceCSS = path.normalize(path.resolve(args.source)) | ||
ngTwConfig.sourceCSS = path.normalize(args.source) | ||
} | ||
if (args.output) { | ||
ngTwConfig.outputCSS = path.normalize(path.resolve(args.output)) | ||
ngTwConfig.outputCSS = path.normalize(args.output) | ||
} | ||
@@ -62,0 +62,0 @@ |
@@ -8,4 +8,7 @@ const fs = require('fs') | ||
let currentConfig = null | ||
if (fs.existsSync(ngTwFile)) currentConfig = require(ngTwFile) | ||
if (fs.existsSync(ngTwFile)) { | ||
currentConfig = require(ngTwFile) | ||
} | ||
const defaultConfig = { | ||
@@ -36,13 +39,14 @@ configJS: `${path.normalize('./tailwind.config.js')}`, | ||
writeConfigFile(newConfig, ngTwFile) | ||
return writeConfigFile(newConfig, ngTwFile) | ||
} | ||
function writeConfigFile (config, file) { | ||
fs.writeFile( | ||
file, | ||
`module.exports = { | ||
return new Promise((resolve, reject) => { | ||
fs.writeFile( | ||
file, | ||
`module.exports = { | ||
// Tailwind Paths | ||
configJS: '${config.configJS}', | ||
sourceCSS: '${config.sourceCSS}', | ||
outputCSS: '${config.outputCSS}', | ||
configJS: '${config.configJS.replace(/\\/g, '\\\\')}', | ||
sourceCSS: '${config.sourceCSS.replace(/\\/g, '\\\\')}', | ||
outputCSS: '${config.outputCSS.replace(/\\/g, '\\\\')}', | ||
// Sass | ||
@@ -62,6 +66,12 @@ sass: ${config.sass}, | ||
}\n`, | ||
err => err | ||
? console.error('Error writing to ng-tailwind.js:', err) | ||
: console.log(`${file} updated!`) | ||
) | ||
err => { | ||
if (err) { | ||
console.error('Error writing to ng-tailwind.js:', err) | ||
} else { | ||
console.log(`${file.replace(/\\/g, '\\\\')} updated!`) | ||
} | ||
resolve() | ||
}) | ||
}) | ||
} | ||
@@ -68,0 +78,0 @@ |
{ | ||
"name": "ng-tailwindcss", | ||
"version": "2.2.0", | ||
"version": "2.2.1-beta.0", | ||
"preferGlobal": true, | ||
@@ -11,3 +11,4 @@ "bin": { | ||
"scripts": { | ||
"test": "standard && echo 'All tests pass!'", | ||
"test": "standard && node test", | ||
"tdd": "nodemon test --ignore test/ng-tailwind.js", | ||
"lint": "standard", | ||
@@ -14,0 +15,0 @@ "lint:fix": "standard --fix" |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
39841
11
490
1
12