forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.ssr.client.js
More file actions
46 lines (36 loc) · 1.09 KB
/
webpack.ssr.client.js
File metadata and controls
46 lines (36 loc) · 1.09 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
const
path = require('path'),
webpack = require('webpack'),
WebpackChain = require('webpack-chain'),
VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
const
env = require('./env'),
resolve = file => path.resolve(__dirname, '..', file),
chain = new WebpackChain()
// inject base
require('./webpack.inject.base')(chain)
chain.devtool('#cheap-module-source-map')
chain.entry('client')
.add('webpack-hot-middleware/client?reload=true')
.add(resolve('dev/app.entry-client.js'))
chain.output
.path(resolve('dev'))
.publicPath('/')
.filename('[name].js')
chain.plugin('define')
.use(webpack.DefinePlugin, [{
'process.env': {
NODE_ENV: '"development"',
CLIENT: true,
SERVER: false,
THEME: JSON.stringify(env.theme)
}
}])
// This plugins generates `vue-ssr-client-manifest.json`
chain.plugin('vue-ssr-client')
.use(VueSSRClientPlugin)
chain.plugin('hot-module-replacement')
.use(webpack.HotModuleReplacementPlugin)
chain.optimization
.namedModules(true) // HMR shows filenames in console on update
module.exports = chain.toConfig()