jedwards1211 / meteor-webpack-react

(DEPRECATED) use jedwards1211/crater instead
https://github.com/jedwards1211/crater
374 stars 75 forks source link

Great Package - Can you make an example of #5

Closed reduxdj closed 9 years ago

reduxdj commented 9 years ago

"or if you want to use Sass, you can require the Sass files"?

Specifically, I am using Stylus and also CJSX (coffeescript). I'd like to do the what you say is possible, I Just need an example please

jedwards1211 commented 9 years ago

Sure! You would just need to npm install --save-dev stylus-loader coffee-loader and add them to your Webpack config, like this (copied from their websites):

module: {
  loaders: [
    {
      test: /\.styl$/,
      loader: 'css-loader!stylus-loader?paths=node_modules/bootstrap-stylus/stylus/'
    },
    { test: /\.coffee$/, loader: "coffee-loader" },
    { test: /\.(coffee\.md|litcoffee)$/, loader: "coffee-loader?literate" }
  ]
}

Then in your code (I don't know much CoffeeScript):

require './somestyle.styl'
caffeineRush = require './strong.coffee'
jedwards1211 commented 9 years ago

I'm closing this out, if you have any more questions about this, feel free to PM me!

outluch commented 8 years ago

Hi! I love coffee, so i made a fork with some demo cjsx and configuration for hot module replacement. A bit hacky but works. https://github.com/outluch/meteor-webpack-react-cjsx