How can I using select2 with webpack?

前端 未结 5 1279
醉酒成梦
醉酒成梦 2020-12-14 06:55

I\'m using webpack to manage all my assets, when I use this code to require select2 (https://github.com/select2/select2) I got the error

$(...).selec

5条回答
  •  甜味超标
    2020-12-14 07:33

    Tried all above solutions but the only way I'v managed to use select2 with webpack and rails6 was to add script loaded to the package and use it like:

    import 'select2';
    import 'script-loader!select2/dist/js/select2.js';
    import 'select2/dist/css/select2.css';
    
    

提交回复
热议问题