What's wrong with my brunch-config file

I generated a new project with mix phx.new and followed the instructions in the generated brunch-config.js file to create a separate vendor.js file. Here is an 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 warnings from my 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 missing?

Is something missing in the brunch-config.js boilerplate that could help others avoid this issue? I’ve read most of the docs on brunch.io, but for some reason I find that documentation very hard to follow.

You are not including your node_modules path anywhere, you probably want to add it to your vendor or so like "js/vendor.js": /^(vendor|deps|node_modules).*/ or something like that. :slight_smile:

2 Likes

Awesome @OvermindDL1. That did the trick. I’m going to see if phoenix will take a PR to add this to the generated brunch-config.js file.

2 Likes