Ich benutze die Webpack 2 Node API und ich möchte die run()
Methode unter Verwendung bluebird promitisten.Webpack-Compiler Instanz Promisifikation?
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)
})
Der Fehler Ich erhalte ist:
[TypeError: self.applyPluginsAsync is not a function]
Damit ich bin zu raten, die webpack Code nicht in einer Weise geschrieben, die mit drossel promisification kompatibel ist.
Wenn es eine andere Möglichkeit gibt, die run()
Methode von webpack zu promitifizieren ..?
Alle diese Rückrufe und if
Aussagen sind mir lästig.