Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.