Skip to content

Instantly share code, notes, and snippets.

@MaxySpark
Last active May 16, 2021 14:31
Show Gist options
  • Save MaxySpark/8722ba1f1a722d1404d114a871c56344 to your computer and use it in GitHub Desktop.
Save MaxySpark/8722ba1f1a722d1404d114a871c56344 to your computer and use it in GitHub Desktop.
const HtmlWebPackPlugin = require('html-webpack-plugin');
const MiniCSSExtractlugin = require('mini-css-extract-plugin');
module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /node-modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: { minimize: true }
}
]
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.(png|jpg|svg|gif)$/
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: './src/index.html',
filename: './index.html'
}),
new MiniCSSExtractlugin({
filename: '[name].css',
chunkFilename: '[id].css'
})
]
}
@MaxySpark
Copy link
Author

npm i -D webpack webpack-cli html-webpack-plugin html-loader webpack-dev-server babel-loader @babel/core @babel/preset-env sass-loader css-loader style-loader node-sass mini-css-extract-plugin file-loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment