1

我正在使用 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

谁能帮帮我?

谢谢

4

0 回答 0