Created
November 4, 2018 14:36
-
-
Save jamigibbs/5be58713efb2a2812f3a57eb4a24b4bb to your computer and use it in GitHub Desktop.
Webpack config example with sass
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
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