Brunch recompiles when ignored file is saved
See original GitHub issueDescription
I’m trying to update all of the dependencies in my app so that the addition of babel-brunch
doesn’t fail. Everything is peachy in the package.json
below except that hitting ctrl-s
in sublime on an “ignored” file causes the brunch compile and auto-reload to happen which is not the desired behavior.
To verify that the ignored files are indeed still being ignored, I commented out one of the config.conventions.ignored
lines and noted compiled, but not written
errors as expected. So it seems brunch is correctly ignoring the files during compile, but is triggering a recompile for no reason… Any ideas?
Note that this was all working as expected with much older versions of everything. (See old package.json excerpt below.)
Environment
- Brunch: 2.9.1
- Node: 6.9.2
- NPM: 3.10.9
- Operating system: OSX 10.10.5
package.json
contents
"devDependencies": {
"angularjs-templates-brunch": "~1.0.0",
"auto-reload-brunch": "~2.7.1",
"babel-brunch": "~6.0.6",
"bower": "~1.8.0",
"brunch": "~2.9.1",
"clean-css-brunch": "~2.0.0",
"css-brunch": "~2.6.1",
"javascript-brunch": "~2.0.0",
"keyword-brunch": "git://github.com/urosgruber/keyword-brunch.git#5ee50ec4cbce7f70af32bbca10d3368e90af3e29",
"less-brunch": "~2.7.1",
"package-brunch": "~0.3.1"
},
brunch config contents
exports.config = {
npm: {
enabled: false
},
conventions: {
assets: /(^app\/assets|font)/,
ignored: [
/^(.*?\/)?[_]\w*/,
/\.spec\.js$/,
/\.interface\.js$/,
],
},
modules: {
definition: false,
wrapper: false
},
paths: {
'watched': ['app', 'vendor'],
'public': '_public'
},
files: {
javascripts: {
joinTo: {
'js/app.js': /^app((?!\.spec\.js)(?!\.interface\.js).)*$/,
'js/vendor.js': /^bower_components|^vendor/
},
order: {
before: [
'app/utilities/lodash-mixins.js',
],
}
},
stylesheets: {
joinTo: {
'css/app.css': /^app/
},
order: {
before: ['app/styles/app.less']
}
},
templates: {
joinTo: {
'js/templates.js': /^app/
},
order: {
before: ['app/scripts/app.js']
}
}
},
plugins: {
// include sentry URL in
keyword: {
extraFiles: ['_public/js/app.js'],
map: {
THING: process.env.THING || '',
},
},
// include package.json so that we can grab it in app/services/environment.js
package: {
fileName: '../js/package.js',
fileSource: 'package.json',
nameSpace: 'node',
},
// remove app/ from path strings since it applies to all templates
angular_templates: {
path_transform: function(path) {
return path.replace(/app\//, '');
}
},
// Enable or disable minifying of result js / css files.
// minify: true
},
};
Other useful files
This previously worked with a set of very old dependencies and node 0.12. Here is the relevant package.json bit:
"devDependencies": {
"aang-template-brunch": "~1.7.6",
"auto-reload-brunch": ">= 1.0 < 1.8",
"bower": "~1.3.5",
"brunch": "~1.7",
"clean-css-brunch": ">= 1.0 < 1.8",
"css-brunch": ">= 1.0 < 1.8",
"javascript-brunch": ">= 1.0 < 1.8",
"keyword-brunch": "1.7.8",
"less-brunch": ">= 1.0 < 1.8",
"package-brunch": "^0.3.1"
},
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
@joshvillbrandt one suggestion: scripts from
node_modules/.bin
are available in npm scripts, so there is no need to write whole path. Parentheses aren’t necessary too (exit code will be correct). Your script might be simplified:That still doesn’t help me use brunch the way I’d like to, but thanks for the tip.