File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
connect : ( ) => {
3
+ require ( './build/hook.js' )
3
4
require ( './build/backend.js' )
4
5
}
5
6
}
Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ const app = require('express')()
2
2
const http = require ( 'http' ) . Server ( app )
3
3
const io = require ( 'socket.io' ) ( http )
4
4
const path = require ( 'path' )
5
+ const fs = require ( 'fs' )
5
6
6
7
const port = process . env . PORT || 8098
7
8
8
9
app . get ( '/' , function ( req , res ) {
9
- res . sendFile ( path . join ( __dirname , '/build/backend.js' ) )
10
+ const hookContent = fs . readFileSync ( path . join ( __dirname , '/build/hook.js' ) , 'utf8' )
11
+ const backendContent = fs . readFileSync ( path . join ( __dirname , '/build/backend.js' ) , 'utf8' )
12
+ res . send ( [ hookContent , backendContent ] . join ( '\n' ) )
10
13
} )
11
14
12
15
// Middleman
Original file line number Diff line number Diff line change 1
1
import io from 'socket.io-client'
2
2
import { initBackend } from 'src/backend'
3
- import { installHook } from 'src/backend/hook'
4
3
import Bridge from 'src/bridge'
5
4
6
5
( function ( ) {
@@ -21,10 +20,6 @@ import Bridge from 'src/bridge'
21
20
socket . disconnect ( )
22
21
} )
23
22
24
- if ( ! window . __VUE_DEVTOOLS_GLOBAL_HOOK__ ) {
25
- installHook ( window )
26
- }
27
-
28
23
initBackend ( bridge )
29
24
socket . emit ( 'vue-devtools-init' )
30
25
} ( ) )
Original file line number Diff line number Diff line change
1
+ import { installHook } from 'src/backend/hook'
2
+
3
+ if ( ! window . __VUE_DEVTOOLS_GLOBAL_HOOK__ ) {
4
+ installHook ( window )
5
+ }
Original file line number Diff line number Diff line change @@ -12,11 +12,12 @@ module.exports = {
12
12
entry : {
13
13
devtools : './src/devtools.js' ,
14
14
backend : './src/backend.js' ,
15
+ hook : './src/hook.js'
15
16
} ,
16
17
output : {
17
18
path : __dirname + '/build' ,
18
19
publicPath : '/build/' ,
19
- filename : '[name].js' ,
20
+ filename : '[name].js'
20
21
} ,
21
22
resolve : {
22
23
alias
@@ -25,7 +26,7 @@ module.exports = {
25
26
rules : [
26
27
{
27
28
test : / \. j s $ / ,
28
- loader : 'buble-loader' ,
29
+ loader : 'buble-loader' ,
29
30
exclude : / n o d e _ m o d u l e s | v u e \/ d i s t | v u e x \/ d i s t / ,
30
31
options : bubleOptions
31
32
} ,
@@ -47,8 +48,5 @@ module.exports = {
47
48
hints : false
48
49
} ,
49
50
devtool : '#cheap-module-source-map' ,
50
- devServer : {
51
- quiet : true
52
- } ,
53
- plugins : process . env . VUE_DEVTOOL_TEST ? [ ] :[ new FriendlyErrorsPlugin ( ) ]
51
+ plugins : process . env . VUE_DEVTOOL_TEST ? [ ] : [ new FriendlyErrorsPlugin ( ) ]
54
52
}
You can’t perform that action at this time.
0 commit comments