ForbesLindesay / browserify-middleware

express middleware for browserify, done right
http://browserify.org
MIT License
381 stars 66 forks source link

Require coffeescript module doesn't work correctly after update from 2.6 to 3 #61

Open yazla opened 9 years ago

yazla commented 9 years ago

Hi,

I have a node_modules dir with modules written in iced-coffeescript. And i do

require('module-written-in-coffee')

in the clientside code. It worked perfectly fine before i have updated it to 3.0. Now it treats the required modules as js no matter what transformers i use. My node config is

.use('/app.js', browserify(clientside_path + '/app.coffee', {transform : ['icsify']}))

Thats actually cost me about 4 hours of time to figure out.

startswithaj commented 9 years ago

I have this same problem too. Did you find a resolution?

yazla commented 9 years ago

No, i just rolled back to browserify-middleware v 2.6.1.

raine commented 9 years ago

Seems to happen with liveify and LiveScript as well.

raine commented 9 years ago

I ran into the same issue with gulp.

SyntaxError: missing `//` on line 1
at src/app.ls while parsing file: src/app.ls

Removing the list of transforms from

b = browserify do
    entries: './src/app.ls',
    debug: true,
    transform: [liveify]

and instead specifying it in package.json like

"browserify": {
  "transform": [
    "liveify"
  ]
}

seems to have fixed it. Maybe that solution could apply to browserify-middleware as well.