Webpack: how to make angular auto-detect jQuery and use it as angular.element instead of jqLite?

前端 未结 5 1013
甜味超标
甜味超标 2021-01-31 14:42

I\'m using Webpack to build an Angular 1.4 project. The project makes use of several jQuery plugins, which are wrapped into angular directives. Those directives internally use <

5条回答
  •  孤独总比滥情好
    2021-01-31 15:42

    In your case is better to use ProvidePlugin. Just add this lines to your webpack config in plugins section and jquery will available in your app:

        new webpack.ProvidePlugin({
             "$": "jquery",
             "jQuery": "jquery"
        })
    

提交回复
热议问题