0

What is the best way to use sass with express.js framework. I am starting from teh point where I have already done

npm install sass

I believe previously with express 2.x one could do something like -

app.use(express.compiler({ src: pub, enable: ['sass'] }))

But with express 3.x it gives me error :

  app.init();
  return app;
} has no method 'compiler'

What is the alternative statement to include in express 3.x?

Similarly if one could let me know the same on how to plugin coffeescript that would be great help.

I have seen examples of using Cakefile to precompile, but is that the only solution? That would mean adding an extra step of running a Cake task. What advantage would that have as against something defined within express app.js / app.coffee.

I have looked at connect-assets (which does coffeescript but not sass) and somewhere one also mentioned about connect-assetmanager pre hook, but haven't been able to make that work.

Sam Wilder
  • 869
  • 1
  • 9
  • 21

1 Answers1

0

https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x says:

template engine compliance from engine.compile(str, options) => Function to engine.__express(filename, options, callback)

Max
  • 8,671
  • 4
  • 33
  • 46