Last active
February 16, 2016 08:57
-
-
Save dshster/9e91fba5c811842318ca to your computer and use it in GitHub Desktop.
Webpack PostCSS bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var css = require('./styles.postcss'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
background-color: #faf; | |
} | |
body { | |
margin: 0; | |
} | |
body:before { | |
display: block; | |
content: url('./images/[email protected]'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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