我正在使用 webpack,angularjs 做一个项目。在 webpack.config.js 中,我有时看到他们使用:
在app.js中
require('angular')
在webpack.config.js 中
new webpack.DefinePlugin({
'require.specified': 'require.resolve'
}
在webpack.config.js 中
new webpack.ProvidePlugin({
Promise: 'bluebird'
}
在webpack.config.js 中
{
test: require.resolve('rxjs/bundles/Rx'),
use:[
{
loader: 'expose-loader',
options: 'Rx'
}
]
}
我不明白他们有什么区别。我什么时候应该使用require
, require.resolve
, webpack.DefinePlugin
,webpack.ProvidePlugin
谁能帮帮我?
谢谢