Brunch clock does not process files on subsequent changes while running in Vagrant / Virtualbox
I am currently working with Vagrant / Virtualbox development environment. My web project is a django / Angularjs project where all the starter scaffolding is done with a branch.
Brunch works fine when I use the command brunch build
, but when I use the command brunch watch
my javascript files are not processed by the brunch when I make changes to the project on my host machine.
I've tried using nfs config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= "nfs"
folder sync and Virtualbox default folder sync but doesn't seem to work with brunch watch
.
Below is my brunch-config.js file:
exports.config = {
paths: {
watched: [
'app',
'assets',
'styles',
'vendor',
]
},
files: {
javascripts: {
joinTo: {
'javascript/app.js': /^app/,
'javascript/vendor.js': /^(vendor|bower_components)/,
}
},
stylesheets: {
joinTo: {
'styles/app.css': /^styles/,
'styles/vendor.css': /^(vendor|bower_components)/,
}
}
},
conventions: {
assets: function(path) {
/**
* Loops every path and returns path|true|false according what we need
* @param path file or directory path
* @returns path if it is a directory
* true if it fit with the regular expression
* false otherwise
*
*/
if( /\/$/.test(path) ) return path;
// /^app\/.*\.html/.test(path) ||
// RegExp for anything we need
return /assets[\\/]/.test(path)
|| /.*(?:\.eot|\.svg|\.ttf|\.woff2|\.woff)/.test(path);
}
},
plugins: {
afterBrunch: [
'mv public/bootstrap/dist/fonts/* public/fonts',
'rm -r public/bootstrap',
'mv public/bootstrap-material-design/dist/fonts/* public/fonts/',
'rm -r public/bootstrap-material-design',
]
}
}
source to share