Skip to content

Instantly share code, notes, and snippets.

@mohnatus
Created January 9, 2022 19:24
Show Gist options
  • Save mohnatus/56072dbf59da6b7e34b50bb2817b35c6 to your computer and use it in GitHub Desktop.
Save mohnatus/56072dbf59da6b7e34b50bb2817b35c6 to your computer and use it in GitHub Desktop.
module.exports = (env={}, argv={}) => {
return {
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
use: "babel-loader"
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
disable: argv.mode === 'development'
}
}
]
}
],
},
plugins: [
argv.mode === "development"
? new HtmlWebpackPlugin()
: null
].filter(plugin => !!plugin)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment