-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdebug.js
37 lines (32 loc) · 937 Bytes
/
debug.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
/**
* @file 调试入口
* @author wangyisheng@outlook.com (wangyisheng)
*/
'use strict';
/* eslint-disable fecs-no-require */
/* eslint-disable no-console */
require('babel-core/register')({
plugins: [
'transform-async-to-generator',
'transform-decorators-legacy',
'transform-es2015-modules-commonjs'
]
});
let router = require('./lib/router').default;
global.self = {
addEventListener(event, listener) {
if (event === 'fetch') {
setTimeout(() => {
let matchItem = router.match({
method: 'get',
referrer: 'https://m.baidu.com/sf?word=123',
url: 'https://m.baidu.com/se/static/js/uiamd/bdbox/follow_4ff41a2.js'
});
console.log(matchItem);
}, 500);
}
}
};
require('./main');
/* eslint-enable fecs-no-require */
/* eslint-enable no-console */