-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.server.config.js
More file actions
41 lines (40 loc) · 1.12 KB
/
Copy pathwebpack.server.config.js
File metadata and controls
41 lines (40 loc) · 1.12 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
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.config')
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin')
module.exports = merge(baseWebpackConfig, {
target: 'node',
entry: {
app: './src/entry-server.js'
},
devtool: 'source-map',
output: {
filename: 'server.bundle.js',
libraryTarget: 'commonjs2'
},
externals: Object.keys(require('./package.json').dependencies),
// externals: nodeExternals({
// // do not externalize dependencies that need to be processed by webpack.
// // you can add more file types here e.g. raw *.vue files
// // you should also whitelist deps that modifies `global` (e.g. polyfills)
// whitelist: /\.css$/
// }),
plugins: [
new webpack.DefinePlugin({
'process.env': 'production'
}),
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false
// }
// }),
new VueSSRServerPlugin()
],
optimization: {
splitChunks: {
// include all types of chunks
chunks: "all"
}
}
})