brunch / auto-reload-brunch

Adds automatic browser reloading support to brunch.
88 stars 30 forks source link

Client-side script not injected #34

Closed martintietz closed 11 years ago

martintietz commented 11 years ago

Hi!

My current config.js looks like the following and using this setup the client-side websocket code is not injected into app.js nor vendor.js:

exports.config = {
  files: {
    javascripts: {
      joinTo: {
        'js/app.js': /^app/,
        'js/vendor.js': /^(bower_components|vendor)/
      }
    },
   ...
};

Everything works fine if I use this configuration:

exports.config = {
  files: {
    javascripts: {
      joinTo: 'js/app.js'
    },
   ...
};

Why that? Stumbled upon this issue, but did not find a solution for my problem: https://github.com/brunch/brunch/issues/419

es128 commented 11 years ago

What version of brunch are you using? brunch --version

Everything else is the same when you make that config change and it works? Same CLI switches, etc?

What happens if you define a pluginHelpers property?

https://github.com/brunch/brunch/blob/master/docs/config.md#files

martintietz commented 11 years ago

What version of brunch are you using? Brunch version is 1.7.4.

Everything else is the same when you make that config change and it works? Same CLI switches, etc? Yes, the only change is inside the javascripts object of the config file.

What happens if you define a pluginHelpers property? Tried to use both pluginHelpers: 'js/app.js' and pluginHelpers: 'js/vedor.js'. Result: Still no injection of the websocket code.

es128 commented 11 years ago

package.json? I still suspect a version mismatch somewhere.

martintietz commented 11 years ago

package.json:

{
  ...
  "dependencies": {
    "express": "3.1.x"
  },
  "devDependencies": {
    "bower": "~0.9.2",
    "brunch": "~1.7.4",
    "auto-reload-brunch": "~1.6.5",
    "javascript-brunch": "~1.7.0",
    "css-brunch": "~1.7.0",
    "uglify-js-brunch": "~1.7.2",
    "clean-css-brunch": "~1.6.0"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.2.x"
  }
}
es128 commented 11 years ago

Did you actually run brunch --version to check the version? If you have a <1.7.0 version installed globally that would explain this, and we've seen confusion come up here and there regarding the global vs local installation.

Aside from that, please cleanly install your plugins just in case - rm -rf node_modules && npm install - and try it again.

paulmillr commented 11 years ago

try to Put it in dependencies

martintietz commented 11 years ago

@es128 Yes, I did run brunch --version ;) Removed and reinstalled all modules - no improvement.

@paulmillr Moved it from devDependencies to dependencies - no improvement.

es128 commented 11 years ago

You're running watch, not build, right?

Let's try this (assuming you're not on windows):

mkfifo brunchpipe
DEBUG=brunch:* brunch w 2> brunchpipe | grep "auto" brunchpipe

Try it with the working and non-working config settings.

martintietz commented 11 years ago

There it is ;) Using brunch watch (shame on me) and pluginHelpers: 'js/app.js' solved the issue. Thanks for your quick help!

es128 commented 11 years ago

you shouldn't actually need pluginHelpers unless you prefer for it to go there instead of vendor