Last active
May 16, 2021 14:31
-
-
Save MaxySpark/8722ba1f1a722d1404d114a871c56344 to your computer and use it in GitHub Desktop.
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 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' | |
}) | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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