-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.server.js
32 lines (31 loc) · 928 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
30
31
32
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const serverConfig = {
mode: "development",
entry: "./src/ssr/server.js",
target: "node",
externals: [nodeExternals()],
output: {
path: path.resolve('.ssr-server-cache'),
filename: 'server.js'
},
resolve: {
extensions: ["*", ".js", ".jsx"],
},
module: {
rules: [
{test: /\.(js|jsx)$/, use: 'babel-loader'},
{test: /\.(png|woff|woff2|eot|ttf|svg|jpg|jpeg)$/, use: 'url-loader'},
{test: /\.css$/, use: [MiniCssExtractPlugin.loader, "css-loader"]},
],
},
plugins: [
new webpack.ProvidePlugin({
"React": "react",
}),
new MiniCssExtractPlugin(),
],
};
module.exports = [serverConfig];