-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
108 lines (106 loc) · 2.85 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
const path = require('path');
const webpack = require('webpack');
let FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPluginConfigIndex = new HtmlWebpackPlugin({
title: 'Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'index.html',
inject: true,
chunks: ['main']
});
const HtmlWebpackPluginConfigResume = new HtmlWebpackPlugin({
title: 'Resumé - Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'resume.html',
inject: true,
chunks: ['main']
});
const HtmlWebpackPluginConfigApps = new HtmlWebpackPlugin({
title: 'Apps - Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'apps.html',
inject: true,
chunks: ['main']
});
const HtmlWebpackPluginConfigWinery = new HtmlWebpackPlugin({
title: 'Winery - Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'winery.html',
inject: true,
chunks: ['main']
});
const HtmlWebpackPluginConfigCredits = new HtmlWebpackPlugin({
title: 'Credits - Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'credits.html',
inject: true,
chunks: ['main']
});
const HtmlWebpackPluginConfigError = new HtmlWebpackPlugin({
title: 'Error - Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'error.html',
inject: true,
chunks: ['main']
});
const HtmlWebpackPluginConfigDownloads = new HtmlWebpackPlugin({
title: 'Downloads - Viraj Chitnis',
template: './src/App/html/index.ejs',
filename: 'downloads.html',
inject: true,
chunks: ['downloads']
});
const HtmlWebpackPluginConfigError50x = new HtmlWebpackPlugin({
title: 'Error - Viraj Chitnis',
template: './src/App/html/error50x.ejs',
filename: 'error50x.html',
inject: false
});
module.exports = {
entry: {
main: './src/App/index.jsx',
downloads: './src/Pages/DownloadsPage/entry.jsx'
},
output: {
path: path.resolve('public'),
filename: 'bundle.[name].[hash].js'
},
plugins: [
new FaviconsWebpackPlugin('./src/App/favicon.png'),
HtmlWebpackPluginConfigIndex,
HtmlWebpackPluginConfigResume,
HtmlWebpackPluginConfigApps,
HtmlWebpackPluginConfigWinery,
HtmlWebpackPluginConfigCredits,
HtmlWebpackPluginConfigError,
HtmlWebpackPluginConfigDownloads,
HtmlWebpackPluginConfigError50x
],
module: {
loaders: [
{
test: /\.(jpg|png|svg)$/,
loader: 'file-loader',
options: {
name: './images/[name].[hash].[ext]',
}
},
{
test: /\.(jsx|js)$/,
loader: 'babel-loader',
include: __dirname + '/src'
},
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
include: __dirname + '/src'
}
]
},
devServer: {
contentBase: path.join(__dirname, "public"),
compress: true,
port: 8000
}
}