-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
105 lines (104 loc) · 3.18 KB
/
webpack.config.js
File metadata and controls
105 lines (104 loc) · 3.18 KB
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
const HTMLWebpackPlugin = require('html-webpack-plugin');
const Webpack = require('webpack');
module.exports = {
entry: {
index: __dirname + '/src/index.jsx',
water: __dirname + '/src/water.jsx',
earth: __dirname + '/src/earth.jsx',
about: __dirname + '/src/about.jsx',
index_en: __dirname + '/src/index.en.jsx',
water_en: __dirname + '/src/water.en.jsx',
earth_en: __dirname + '/src/earth.en.jsx',
about_en: __dirname + '/src/about.en.jsx',
},
module: {
rules: [
{
test: /\.jsx$/,
// exclude: ["/node_modules/", "/public/", "/routes/", "/src/", "/app.js", "/server.js"],
loader: "babel-loader",
},
{
test: /\.css$/,
exclude: ["/public/stylesheets/"],
use: ['style-loader', 'css-loader']
},
{
test: /\.less$/,
use: [{
loader: 'style-loader'
},
{
loader: "css-loader"
},
{
loader: "less-loader",
options: {
lessOptions: {
modifyVars: {
}
}
}
}]
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader: "file-loader"
},
]
},
output: {
filename: '[name].js',
path: __dirname + '/build',
},
plugins: [
new HTMLWebpackPlugin({
inject: true,
chunks: ["index"],
filename: "index.min.html",
template: __dirname + "/views/index.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["water"],
filename: "water.min.html",
template: __dirname + "/views/water.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["earth"],
filename: "earth.min.html",
template: __dirname + "/views/earth.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["about"],
filename: "about.min.html",
template: __dirname + "/views/about.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["index_en"],
filename: "index.en.min.html",
template: __dirname + "/views/index.en.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["water_en"],
filename: "water.en.min.html",
template: __dirname + "/views/water.en.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["earth_en"],
filename: "earth.en.min.html",
template: __dirname + "/views/earth.en.html"
}),
new HTMLWebpackPlugin({
inject: true,
chunks: ["about_en"],
filename: "about.en.min.html",
template: __dirname + "/views/about.en.html"
})
]
};