-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
52 lines (49 loc) · 1.26 KB
/
vue.config.js
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
49
50
51
52
const express = require('express')
const VueAutomaticImportPlugin = require(
'vue-automatic-import-loader/lib/plugin'
)
const plugins = []
plugins.push(new VueAutomaticImportPlugin({
match (originalTag, { kebabTag, camelTag }) {
if (kebabTag.startsWith('b-')) {
return [
camelTag,
`import {${camelTag}} from 'bootstrap-vue'`
]
}
}
}))
if (process.env.WEBPACK_STATS) {
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
plugins.push(new BundleAnalyzerPlugin())
}
module.exports = {
publicPath: process.env.PUB_PATH || '/',
configureWebpack: { plugins, devtool: 'source-map' },
devServer: {
setup (app) {
app.get(/api\/.*/, (req, res, next) => {
req.url = req.path + '.json'
next()
})
app.use('/api', express.static('api'))
app.post('/api/booking/book', (req, res) => {
const reqJ = JSON.parse(req.body)
res.json({
vercode: reqJ.vercode
})
})
app.post('/api/login', (req, res) => {
res.json({
message: 'Logged In',
user: {
token: '1234567890',
timestamp: '1234567890',
rawId: '1234567890',
id: '1234567890'
}
})
})
}
}
}