-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.common.js
More file actions
41 lines (40 loc) · 963 Bytes
/
Copy pathwebpack.common.js
File metadata and controls
41 lines (40 loc) · 963 Bytes
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
require('dotenv').config()
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve('build'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.css$/,
exclude: /\.module\.css$/,
use: [{loader: 'style-loader'}, {loader: 'css-loader'}],
},
{
test: /\.module\.css$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader', options: {modules: true, camelCase: true}},
],
},
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
use: 'file-loader',
},
],
},
plugins:[
new CleanWebpackPlugin('build'),
new HtmlWebpackPlugin({template: 'index.html'}),
],
}