Laravel 5 WebPack JQuery - $ is not defined

前端 未结 4 844
慢半拍i
慢半拍i 2021-01-05 09:08

I Have webpack.min.js:

mix.webpackConfig(webpack => {
    return {
        plugins: [
            new webpack.ProvidePlugin({
                $: \'jquery\         


        
4条回答
  •  迷失自我
    2021-01-05 10:06

    I use mix.copy instead mix.js for jQuery and it works great!

    example:

    mix.copy('node_modules/jquery/dist/jquery.min.js', 'public/vendor/jquery/jquery.min.js');
    

提交回复
热议问题