forked from ilkeraltin/react-ssr-news
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.server.js
More file actions
27 lines (22 loc) · 752 Bytes
/
webpack.server.js
File metadata and controls
27 lines (22 loc) · 752 Bytes
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
const path = require('path');
const merge = require('webpack-merge');
const webpackNodeExternals = require('webpack-node-externals');
const baseConfig = require('./webpack.base.js');
const config = {
// Inform webpack that we're building a bundle
// for nodeJS, rather than for the browser
target: 'node',
mode: 'production',
// Tell webpack the root file of our
// server application
entry: './src/index.js',
// We don't serve bundle.js for server, so we can use dynamic external imports
externals: [webpackNodeExternals()],
// Tell webpack where to put the output file
// that is generated
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'build')
}
};
module.exports = merge(baseConfig, config);