Created
August 3, 2019 16:22
-
-
Save ovpv/94550425e98d2a4e1022fc0ab4de61e9 to your computer and use it in GitHub Desktop.
Webpack config for React SSR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
module.exports = [ | |
{ | |
entry: { | |
client: "./src/client/index.js" | |
}, | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: "[name].js" | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.(js|jsx)$/, | |
exclude: /node_modules/, | |
use: { | |
loader: "babel-loader" | |
} | |
} | |
] | |
} | |
}, | |
{ | |
target: "node", | |
entry: { | |
server: "./src/server.js" | |
}, | |
node: { | |
dns: "mock", | |
fs: "empty", | |
path: true, | |
url: false, | |
net: "empty" | |
}, | |
output: { | |
path: path.resolve(__dirname), | |
filename: "[name].js" | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.(js|jsx)$/, | |
exclude: /node_modules/, | |
use: { | |
loader: "babel-loader" | |
} | |
} | |
] | |
} | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment