1 |
|
2 | const
|
3 | Bluebird = require('bluebird')
|
4 |
|
5 | try {
|
6 | Bluebird.config({
|
7 |
|
8 | monitoring: process.env.NODE_ENV === 'development',
|
9 | longStackTraces: process.env.NODE_ENV === 'development',
|
10 | warnings: {
|
11 | wForgottenReturn: false
|
12 | }
|
13 | })
|
14 | } catch (err) {
|
15 | try {
|
16 | console.warn(`Unable to configure promises, likely already configured`)
|
17 | } catch (err2) {}
|
18 | }
|
19 |
|
20 | const
|
21 | g = global as any
|
22 |
|
23 | Promise = Bluebird
|
24 | g.Promise = Bluebird
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | require('babel-runtime/core-js/promise').default = require('bluebird')
|
30 |
|
31 |
|
32 |
|