Skip to content

Instantly share code, notes, and snippets.

@jamigibbs
Created November 4, 2018 14:36
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 jamigibbs/5be58713efb2a2812f3a57eb4a24b4bb to your computer and use it in GitHub Desktop.
Save jamigibbs/5be58713efb2a2812f3a57eb4a24b4bb to your computer and use it in GitHub Desktop.
Webpack config example with sass
const isDev = process.env.NODE_ENV === 'development'
module.exports = {
mode: isDev ? 'development' : 'production',
entry: [
'@babel/polyfill', // enables async-await
'./client/index.js'
],
output: {
path: __dirname,
filename: './public/bundle.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment