I am using the Webpack 2 Node API and I would like to promise a method run()using bluebird .
import Promise from 'bluebird'
import webpack from 'webpack'
const compiler = webpack(config)
const runAsync = Promise.promisify(compiler.run)
runAsync().then(stats => {
console.log('stats:', stats)
}).catch(err => {
console.log('err:', err)
})
The error I get is:
[TypeError: self.applyPluginsAsync is not a function]
So, I assume that the webpack code is not written in a way that is compatible with the bluebird promise.
If there is another way to promise the webpack run().. method ?
All of these callbacks and expressions are iflistening to me.
source
share