-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
42 lines (41 loc) · 1.01 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const glob = require('glob');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ImageMinPlugin = require('imagemin-webpack-plugin').default;
const webpack = require('webpack');
module.exports = {
entry: './src/index.js',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.(css|scss)$/,
use: [
{ loader: 'style-loader' },
{ loader: 'file-loader' },
{ loader: 'css-loader' },
{ loader: 'sass-loader' },
],
},
],
},
plugins: [
new webpack.SourceMapDevToolPlugin({ filename: '[name].js.map' }),
new HtmlWebpackPlugin({
title: '#EBMNAO - Devolvam o nosso Flamengo vencedor!',
template: 'src/templates/index.html',
}),
new ImageMinPlugin({
externalImages: {
context: 'src',
sources: glob.sync('src/images/**/*'),
destination: 'dist',
},
}),
],
};