Skip to content

Instantly share code, notes, and snippets.

@dghuy
Created September 8, 2016 20:24
Show Gist options
  • Save dghuy/6ca0a3cef67d217223f87729bec51b9d to your computer and use it in GitHub Desktop.
Save dghuy/6ca0a3cef67d217223f87729bec51b9d to your computer and use it in GitHub Desktop.
Webpack Babel React SCSS PostCSS
"dependencies": {
"autoprefixer": "^6.4.1",
"babel": "^6.5.2",
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.11.1",
"css-loader": "^0.25.0",
"node-sass": "^3.9.3",
"postcss-loader": "^0.13.0",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.15.1"
}
const webpack = require('webpack');
module.exports = {
entry: './main.js',
output: {
path: __dirname,
filename: './dist.js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
inline: true
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
},
{
test: /\.scss$/,
loader: "style-loader!css-loader!sass-loader!postcss-loader"
}
]
},
postcss: function () {
return [require('autoprefixer')];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment