2018-09-02 23:26:15 +03:00
|
|
|
const path = require('path')
|
|
|
|
const merge = require('webpack-merge')
|
|
|
|
const nodeExternals = require('webpack-node-externals')
|
2019-04-18 00:52:43 +03:00
|
|
|
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin')
|
|
|
|
const WebpackBar = require('webpackbar')
|
2018-09-02 23:26:15 +03:00
|
|
|
const baseConfig = require('./webpack.base.conf')
|
|
|
|
|
2019-04-18 00:52:43 +03:00
|
|
|
const isProduction = process.env.NODE_ENV === 'production'
|
2018-10-03 00:07:01 +03:00
|
|
|
|
2018-09-02 23:26:15 +03:00
|
|
|
const webpackConfig = merge(baseConfig, {
|
2019-04-18 00:52:43 +03:00
|
|
|
mode: isProduction ? 'production' : 'development',
|
|
|
|
entry: path.resolve(__dirname, '../client/entry.server.ts'),
|
2019-08-03 05:18:26 +03:00
|
|
|
devtool: isProduction ? false : 'source-map',
|
|
|
|
target: 'node',
|
2018-09-02 23:26:15 +03:00
|
|
|
output: {
|
|
|
|
libraryTarget: 'commonjs2'
|
|
|
|
},
|
|
|
|
externals: nodeExternals({
|
|
|
|
whitelist: [
|
|
|
|
/\.css$/,
|
2019-04-18 00:52:43 +03:00
|
|
|
/\.sass$/,
|
|
|
|
/\.scss$/,
|
2019-08-03 05:18:26 +03:00
|
|
|
/\.svg$/,
|
|
|
|
/vuetify\/.*/
|
2018-09-02 23:26:15 +03:00
|
|
|
]
|
|
|
|
}),
|
|
|
|
|
|
|
|
plugins: [
|
2019-04-18 00:52:43 +03:00
|
|
|
new VueSSRServerPlugin(),
|
|
|
|
new WebpackBar({
|
|
|
|
name: 'Server',
|
|
|
|
color: 'orange'
|
|
|
|
})
|
2018-09-02 23:26:15 +03:00
|
|
|
]
|
|
|
|
})
|
|
|
|
|
|
|
|
module.exports = webpackConfig
|