-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.config.base.js
72 lines (70 loc) · 1.87 KB
/
webpack.config.base.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: [
'babel-polyfill',
'./client/src/index.js',
],
output: {
path: path.resolve(__dirname, 'client', 'dist'),
filename: './scripts/bundle.js'
},
resolve: {
modules: [
path.join(__dirname, 'client/src/'),
'node_modules',
],
alias: {
'shared': path.join(__dirname, 'shared/')
},
},
module: {
rules: [
{
test: /\.js?$/,
include: [
path.resolve(__dirname, 'client'),
path.resolve(__dirname, 'shared'),
path.resolve(__dirname, 'node_modules', 'redux-action-minifier'),
],
use: [
{
loader: 'babel-loader',
options: {
presets: ['react', ['es2015', { modules: false }]],
}
}
],
},
{
test: /\.styl$/,
use: [
'style-loader',
'css-loader',
'stylus-loader',
],
},
{
test: /\.pug$/,
use: 'pug-loader'
},
{
test: /\.png$/,
use: [
{
loader: 'url-loader',
options: {
limit: 150000,
}
},
]
},
]
},
plugins: [
new HtmlWebpackPlugin({
title: 'WebSocket Challenge',
template: './client/src/index.template.pug'
}),
]
};