-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds watching for less files -- closes #10 #14
Conversation
buildScripts/buildLess.js
Outdated
@@ -9,6 +9,7 @@ import fs from 'fs'; | |||
import less from 'less'; | |||
import mkdirp from 'mkdirp'; | |||
import path from 'path'; | |||
import chokidar from 'chokidar'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetize imports
buildScripts/buildLess.js
Outdated
console.log(chalk.red('--watch not yet implemented')); | ||
process.exit(1); | ||
chokidar.watch(PATH_TO_WATCH).on('all', (event, path) => { | ||
if (event === "add" || event === "change") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer a switch statement instead of a series of if statments
buildScripts/buildLess.js
Outdated
console.log(chalk.blue(event, path)); | ||
compileLessAndWriteToCSSFile(path) | ||
.then(() => { | ||
console.log(chalk.green('Done compiling ' + path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use template strings:
`Done compiling ${path}`
buildScripts/buildLess.js
Outdated
console.log(chalk.red('--watch not yet implemented')); | ||
process.exit(1); | ||
chokidar.watch(PATH_TO_WATCH).on('all', (event, path) => { | ||
if (event === "add" || event === "change") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no double quotes, only single quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just some styling things
buildScripts/buildLess.js
Outdated
console.log(chalk.green('Done compiling ' + path)); | ||
}); | ||
} | ||
if (event === "unlink") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quotes
buildScripts/buildLess.js
Outdated
const cssMapFilename = Stylesheets.getDistCSSMapFileForLessFile(path); | ||
Promise.all([removeFile(cssFilename), removeFile(cssMapFilename)]); | ||
} | ||
if (event === "unlinkDir") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quotes
buildScripts/buildLess.js
Outdated
const cssFilepath = Stylesheets.getDistCSSPathForLessPath(path); | ||
removePath(cssFilepath); | ||
} | ||
if (event === "addDir" && path !== PATH_TO_WATCH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single quotes
No description provided.