Level 7
So I discovered that if I change webpack.mix.js to:
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
const webpack = require('webpack');
mix.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery',
}),
]
});
mix.js([
'resources/js/vendor/select2/select2.js',
'resources/js/vendor/pikaday/pikaday.js',
'resources/js/app.js'
], 'public/js/app.js')
// .extract([
// 'jquery'
// ])
.autoload({
jquery: ['$', 'window.jQuery']
// jquery: ['$', 'window.$', 'window.jQuery']
})
.sass('resources/sass/app.scss', 'public/css');
the jQuery is not defined is not there. But then the next problem is:
Pikaday is not defined
I am 100% sure the file resources/js/vendor/pikaday/pikaday.js is there. So what is going on now?
1 like