-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.server.js
29 lines (26 loc) · 763 Bytes
/
webpack.server.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
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
const developmentMode = process.env.NODE_ENV === "development";
const webpackConfigServer = {
mode: developmentMode ? "development" : "production",
target: "node",
externals: [nodeExternals()],
entry: path.resolve(__dirname, "server/index.js"),
module: {
rules: [{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }]
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "server.bundle.js"
},
plugins: [
new webpack.ProvidePlugin({
React: "react"
}),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1
})
]
};
module.exports = webpackConfigServer;