-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
53 lines (52 loc) · 1.65 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
const path = require("path");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
entry: {
changePassword: "./src/js/render-change-password-form.jsx",
createAccount: "./src/js/render-create-account-form.jsx",
createGame: "./src/js/render-game-form.jsx",
index: "./src/js/render-index-page.jsx",
howToPlay: "./src/js/render-how-to-play.jsx",
game: "./src/js/render-game-page.jsx",
login: "./src/js/render-login-form.jsx",
profile: "./src/js/render-profile-page.jsx"
},
resolve: {
extensions: [".js", ".jsx"]
},
output: {
path: path.join(__dirname, "dist"),
filename: "js/[name].bundle.js"
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({ minimize: true }),
new CopyWebpackPlugin([
{ from: "src/frontend-version.json" },
{ from: "src/css", to: "css/" },
{ from: "src/img", to: "img/" },
{ from: "src/favicons", to: "favicons/" },
{ from: "node_modules/react-table/react-table.css", to: "css/" }
])
],
module: {
rules: [
{
test: /\.jsx?$/,
enforce: "pre",
loader: "eslint-loader",
exclude: /node_modules/
},
{
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/
},
{
test: /\.json$/,
loader: "json-loader"
}
]
}
};