-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
38 lines (30 loc) · 1.09 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
const path = require('path');
module.exports = {
mode: process.env.NODE_ENV || 'development',
entry: [
'@babel/polyfill', // enables async-await
'./client/js/index.jsx',
],
output: {
publicPath: '/',
path: path.join(__dirname, '/dist'),
filename: 'bundle.js',
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx'],
},
module: {
rules: [
{test: /\.(js|jsx)?$/, exclude: /node_modules/, use: 'babel-loader'},
{test: /\.(scss|sass)$/, use: ['style-loader', 'css-loader', 'sass-loader']},
{test: /\.png$/, use: 'file-loader'},
{test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader'},
{test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader'},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader'},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader'},
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader'},
{test: /\.jpg(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader'},
],
},
};