fix(jquery): make available globally and to plugins
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'vite/modulepreload-polyfill';
|
||||
import './core/trustedTypePolicies';
|
||||
import './jquery';
|
||||
|
||||
// TODO: Vite should have __wepack_public_path support. Not looked into it yet.
|
||||
// declare let __webpack_public_path__: string;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// Vite: hacky approach to making jQuery globally available
|
||||
import jQuery from 'jquery';
|
||||
Object.assign(window, { $: jQuery, jQuery });
|
||||
+2
-2
@@ -24,8 +24,8 @@ export default defineConfig({
|
||||
},
|
||||
plugins: [react(), angularHtmlImport()],
|
||||
optimizeDeps: {
|
||||
// fix for $ is not a function
|
||||
exclude: ['jquery'],
|
||||
// fixes for dependencies that don't support esm
|
||||
include: ['jquery'],
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
|
||||
Reference in New Issue
Block a user