-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.server.js
More file actions
48 lines (45 loc) · 1.08 KB
/
webpack.config.server.js
File metadata and controls
48 lines (45 loc) · 1.08 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var webpack = require('webpack');
var path = require('path');
var UglifyJSPlugin = require('uglifyjs-webpack-plugin');
var nodeExternals = require('webpack-node-externals');
var WebpackShellPlugin = require('webpack-shell-plugin')
var config = {
target: 'node',
externals: [nodeExternals()],
node: {
__dirname: true,
__filename: true,
},
entry: './backend/main.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'build'),
publicPath: '/'
},
resolve: {
modules: [
'node_modules',
'frontend'
],
extensions: ['.js', '.jsx']
},
module: {
rules: [{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
use: [{
loader: 'babel-loader',
options: {
babelrc: false,
presets: [['es2015', {modules: false}], 'react'],
plugins: ["transform-decorators-legacy", "transform-ensure-ignore"]
}
}]
}]
},
plugins: [
new UglifyJSPlugin(),
// new WebpackShellPlugin({onBuildEnd: ['nodemon build/bundle.js --watch build']})
],
}
module.exports = config