我知道我可以做点什么
## brew info FORMULA_NAME
brew info wgetpaste
Run Code Online (Sandbox Code Playgroud)
wgetpaste: stable 2.20
http://wgetpaste.zlin.dk/
Not installed
https://github.com/mxcl/homebrew/commits/master/Library/Formula/wgetpaste.rb
Run Code Online (Sandbox Code Playgroud)
然后我可以在安装之前按照网址获取有关公式的一些信息.我们有什么方法可以使用brew在命令行中获取此信息吗?
我正在使用webpack捆绑我的JavaScript.我依赖于使用任何承诺的冰棒等模块.
这是我的代码:
var popsicle = require('popsicle');
popsicle.get('/').then(function() {
console.log('loaded URL');
});
Run Code Online (Sandbox Code Playgroud)
这在Promise可用的浏览器中工作正常,但IE 11不提供Promise.所以我想使用es6-promise作为polyfill.
我尝试添加一个明确的ProvidePlugin给我webpack.config.js:
plugins: [
new webpack.ProvidePlugin({
'Promise': 'exports?global.Promise!es6-promise'
})
]
Run Code Online (Sandbox Code Playgroud)
但我仍然在IE 11中得到错误:any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird').
我尝试明确附加全局:
global.Promise = global.Promise || require('es6-promise');
Run Code Online (Sandbox Code Playgroud)
但IE 11给出了一个不同的错误:Object doesn't support this action.
我也尝试过明确注册es6-promise:
require('any-promise/register/es6-promise');
var popsicle = require('popsicle');
Run Code Online (Sandbox Code Playgroud)
这有效,但我必须在每个加载的文件中执行此操作popsicle.我想Promise加入window.
如何window.Promise使用webpack …