-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.ssr.js
33 lines (31 loc) · 1.06 KB
/
webpack.ssr.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
const webpack = require("webpack");
const path = require("path");
const configRules = require("./webpack.common");
const pathToLibrary = (name) =>
path.resolve(__dirname, `./node_modules/${name}`);
module.exports = Object.assign({}, configRules, {
entry: "./src/ssr.js",
target: "node",
mode: "production",
output: {
path: path.resolve(__dirname, "build"),
filename: "ssr.js",
libraryTarget: "commonjs2",
},
resolve: {
alias: {
"apollo-utilities": pathToLibrary("apollo-utilities"),
"core-js": pathToLibrary("core-js"),
"prop-types": pathToLibrary("prop-types"),
"hoist-non-react-statics": pathToLibrary("hoist-non-react-statics"),
"@emotion/memoize": pathToLibrary("@emotion/memoize"),
"@emotion/stylis": pathToLibrary("@emotion/stylis"),
"@emotion/hash": pathToLibrary("@emotion/hash"),
},
},
plugins: [
new webpack.DefinePlugin({
"process.env.SERVER": JSON.stringify(true),
}),
],
});