UNPKG

556 BPlain TextView Raw
1
2const
3 Bluebird = require('bluebird')
4
5try {
6 Bluebird.config({
7 //cancellation: true,
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
20const
21 g = global as any
22
23Promise = Bluebird
24g.Promise = Bluebird
25
26/**
27 * Replace es6-promise with bluebird
28 */
29require('babel-runtime/core-js/promise').default = require('bluebird')
30
31
32