Last active
October 18, 2016 09:06
-
-
Save teebot/f0b3dcbf159ebc768a7327700c176260 to your computer and use it in GitHub Desktop.
create a less file for each component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob'); | |
const fs = require('fs'); | |
glob('**/*.component.ts', (err, files) => { | |
files.forEach((file) => { | |
let lessFileName = file.replace('.component.ts', '.less'); | |
try { | |
fs.statSync(lessFileName); | |
} | |
catch (e) { | |
console.log(`Writing ${lessFileName}`); | |
fs.writeFileSync(lessFileName, '', 'utf8'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will create a less file next to every angular component in the same directory.