Skip to content

Instantly share code, notes, and snippets.

@teebot
Last active October 18, 2016 09:06
Show Gist options
  • Save teebot/f0b3dcbf159ebc768a7327700c176260 to your computer and use it in GitHub Desktop.
Save teebot/f0b3dcbf159ebc768a7327700c176260 to your computer and use it in GitHub Desktop.
create a less file for each component
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');
}
});
});
@teebot
Copy link
Author

teebot commented Oct 18, 2016

Will create a less file next to every angular component in the same directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment