-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
57 lines (56 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var path = require('path');
module.exports = {
// Since webpack 4 we will need to set in what mode webpack is running
mode: 'development',
// This will be the entry file for all of our React code
entry: [
'./client/index.jsx',
],
// This will be where the final bundle file will be outputed
output: {
path: path.join(__dirname, '/server/public/js/'),
filename: 'bundle.js',
publicPath: 'server/public/js/',
},
// Adding babel loader to compile our javascript and jsx files
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
'react',
'env',
],
},
},
},
{
test: /\.less$/,
use: [
{
loader: "style-loader"
},
{
loader: "css-loader",
options: {
sourceMap: true,
modules: true,
localIdentName: "[local]___[hash:base64:5]"
}
},
{
loader: "less-loader"
}
]
}
],
},
watch: true,
resolve: {
extensions: ['.js', '.jsx', '.scss'],
},
};