Skip to content

Instantly share code, notes, and snippets.

@supasympa
Created April 26, 2017 19:49
Show Gist options
  • Select an option

  • Save supasympa/6e4aee679ffdcfd8fde245c61975800c to your computer and use it in GitHub Desktop.

Select an option

Save supasympa/6e4aee679ffdcfd8fde245c61975800c to your computer and use it in GitHub Desktop.
Minimal Webpack / PostCss config to get post CSS up and running
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const webpackConfig = {
devtool: 'source-map',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './build'),
filename: 'index.bundle.js'
},
module: {
rules: [
{
test: /\.css/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader?sourceMap',
'postcss-loader'
]
})
}
]
},
plugins: [
new ExtractTextPlugin('styles.css')
]
}
module.exports = webpackConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment