Skip to content

Instantly share code, notes, and snippets.

@timaschew
Created February 10, 2016 20:35
Show Gist options
  • Select an option

  • Save timaschew/e633fb20a171dc6fdaaf to your computer and use it in GitHub Desktop.

Select an option

Save timaschew/e633fb20a171dc6fdaaf to your computer and use it in GitHub Desktop.
postcss, precss, cssnext, sass
module: {
loaders: [
{
test: /\.js$/,
loaders: [ 'babel' ],
exclude: /node_modules/,
include: path.join(__dirname, 'src')
},
{
test: /\.scss$/,
// autoprefixer comes from http://foundation.zurb.com/sites/docs/sass.html#autoprefixer-required
loader: "style!css!autoprefixer?{browsers:['last 2 versions', 'ie >= 9', 'and_chr >= 2.3']}!sass"
},
{
test: /\.css/,
exclude: [/node_modules/],
// for more informaiton see https://github.com/webpack/css-loader for more information
// and https://github.com/postcss/postcss-loader
loader: 'style!css?module&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss?'
}
]
},
postcss: function(webpack) {
return [
// handle hot reloading for @import'ed files
postcssImport({addDependencyTo: webpack}),
// use Sass-like markup in your CSS
precss,
// use tomorrow’s CSS syntax, today
cssnext({
autoprefixer: ['last 2 version'],
})
]
},
sassLoader: {
includePaths: [path.resolve(__dirname, "node_modules")]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment