Open jordanade opened 5 months ago
No matter how I configure my vite.config.js file, I get "$ is not a function" from livewire-select2's scripts. I've tried:
import inject from '@rollup/plugin-inject'; export default defineConfig({ plugins: [ inject({ $: 'jquery', jQuery: 'jquery', }), ...
and
optimizeDeps: { include: ["jquery"], },
build: { rollupOptions: { output: { // expose jQuery as a global variable globals: { $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', } } } }
With my old webpack/mix setup I was able to make this work with:
mix.webpackConfig(webpack => { return { plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery' }), ], }; });
No matter how I configure my vite.config.js file, I get "$ is not a function" from livewire-select2's scripts. I've tried:
and
and
With my old webpack/mix setup I was able to make this work with: