Generated a new project with mix phx.new and followed the instructions in the generated brunch-config.js file. With the following excerpt from my brunch-config.js file:
files: {
javascripts: {
// joinTo: "js/app.js",
// To use a separate vendor.js bundle, specify two files path
// https://github.com/brunch/brunch/blob/master/docs/config.md#files
joinTo: {
"js/app.js": /^(js)/,
"js/vendor.js": /^(vendor)|(deps)/
},
//
// To change the order of concatenation of files, explicitly mention here
// https://github.com/brunch/brunch/tree/master/docs#concatenation
order: {
// ...
I get the following warns form brunch build.
13:33:28 - warn: node_modules/phoenix_html/priv/static/phoenix_html.js compiled, but not written. Check your javascripts.joinTo config
13:33:28 - warn: node_modules/phoenix/priv/static/phoenix.js compiled, but not written. Check your javascripts.joinTo config
What am I doing wrong? Should comments be updated?
Looks like "js/vendor.js": /^(vendor|deps|node_modules).*/ resolves the issue. Are you interested in a PR to update the boilerplate with the change?
Just as a side note, the Brunch documentation suggests the following:
module.exports = {
files: {
javascripts: {
joinTo: {
'app.js': /^js/, // all code from 'js/',
'vendor.js': /^(?!js)/ // all BUT js code - 'vendor/', 'node_modules/', etc
}
}
}
}
Most helpful comment
Just as a side note, the Brunch documentation suggests the following: