While setting up a basic app using phoenix-elixir
and brunch
, encountering the following error:
23 Mar 10:18:10 - warn: node_modules/phoenix/priv/static/phoenix.js compiled, but not written. Check your javascripts.joinTo config
23 Mar 10:18:10 - warn: node_modules/phoenix_html/priv/static/phoenix_html.js compiled, but not written. Check your javascripts.joinTo config
Here's what is in my branch-config.js
:
files: {
javascripts: {
joinTo: {
"js/app.js": /^(web\/static\/js)/,
"js/script.js": /^(web\/static\/js)/
}
}
// ...
}
This is how my folder structure looks like:
web/
static/
js/
app.js
script.js
Although I observe script.js
being included (it compiles into priv/static/js
and appears as source in dev tools), the functions within it don't behave as expected. They do work if I merge the contents of script.js
into app.js
.
Interestingly, when I handle css
in a similar fashion...
stylesheets: {
joinTo: "css/app.css",
joinTo: "css/style.css"
},
If I structure js
similarly to css
, there are no errors, but again, the functions within won't execute...
javascripts: {
joinTo: "js/app.js",
joinTo: "js/script.js"
}
Should I move script.js
to the vendor
folder instead? Is app.js
the only js
script permissible inside web/js
? It seems like a configuration is missing somewhere.
EDIT:
$ mix phoenix.new -v
Phoenix v1.1.4$ brunch -v
2.1.3