Skip to content

Instantly share code, notes, and snippets.

@dkypooh
Created December 30, 2016 02:29
Show Gist options
  • Select an option

  • Save dkypooh/ff6d41253a36fdb40aef51a3e412b638 to your computer and use it in GitHub Desktop.

Select an option

Save dkypooh/ff6d41253a36fdb40aef51a3e412b638 to your computer and use it in GitHub Desktop.
Postcss Webpack Config
var webpackConfig = require('./webpack.config');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry : './src/style.js',
output : {
filename : 'style.js',
path : './docs'
},
module : {
loaders : [
{
test : /\.css/,
loader: ExtractTextPlugin.extract('style-loader', ['css-loader', 'postcss-loader', 'sass-loader'])
}
]
},
plugins: [
new ExtractTextPlugin("style.css")
],
postcss: function (webpack) {
return [
require('precss')(),
require('postcss-bem')({
separators : {
descendent : '_',
modifier : '-'
}
}),
require('postcss-calc')(),
require("postcss-import")(),
require("postcss-url")(),
require("postcss-nested")(),
require("postcss-cssnext")(),
require('postcss-utilities')()
// require('cssnano')()
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment