forked from vuejs/devtools-v6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (32 loc) · 947 Bytes
/
webpack.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
const path = require('path')
const { createConfig } = require('@vue-devtools/build-tools')
const openInEditor = require('launch-editor-middleware')
module.exports = createConfig({
entry: {
// devtools: require.resolve('@vue-devtools/shell-host/src/devtools.js'),
backend: require.resolve('@vue-devtools/shell-host/src/backend.js'),
hook: require.resolve('@vue-devtools/shell-host/src/hook.js'),
target: './src/index.js',
'iframe-app': './src/iframe-app.js',
},
output: {
path: path.join(__dirname, '/build'),
publicPath: '/target/',
filename: '[name].js',
},
devServer: {
onBeforeSetupMiddleware ({ app }) {
app.use('/__open-in-editor', openInEditor())
},
proxy: {
'/': {
target: 'http://localhost:8091',
bypass: (req, res, proxyOptions) => {
if (req.url.startsWith('/target')) {
return req.url
}
},
},
},
},
})