Skip to content

Instantly share code, notes, and snippets.

@dshster
Last active February 16, 2016 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dshster/9e91fba5c811842318ca to your computer and use it in GitHub Desktop.
Save dshster/9e91fba5c811842318ca to your computer and use it in GitHub Desktop.
Webpack PostCSS bootstrap
var css = require('./styles.postcss');
{
"name": "webpack-sprites",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"dependencies": {
"css-loader": "^0.23.1",
"file-loader": "^0.8.5",
"postcss-loader": "^0.8.1",
"webpack": "^1.12.13"
},
"devDependencies": {},
"scripts": {
"start": "webpack --profile --display-modules --display-reasons",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
html {
background-color: #faf;
}
body {
margin: 0;
}
body:before {
display: block;
content: url('./images/gs-color-logo@3x.png');
}
var path = require('path');
module.exports = {
context: path.join(__dirname, '/'),
entry: './entry',
output: {
path: path.join(__dirname, '/build'),
filename: 'bundle.js'
},
plugins: [
],
module: {
loaders: [{
test: /\.(css|postcss)$/,
exclude: /(node_modules)/,
loader: 'css!postcss-loader'
}, {
test: /\.png$/,
loader: 'file?name=img-[name]-[hash:6].[ext]'
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment