Skip to content

Commit

Permalink
fix jQuery import
Browse files Browse the repository at this point in the history
  • Loading branch information
f-w committed Dec 11, 2024
1 parent cb616ab commit cb2205b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
42 changes: 42 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
"iframe-resizer": "^4.3.1",
"roboto-fontface": "*",
"vue": "^3.4.31",
"webfontloader": "^1.0.0",
"vuetify": "^3.6.14"
"vuetify": "^3.6.14",
"webfontloader": "^1.0.0"
},
"devDependencies": {
"@json-editor/json-editor": "^2.10.1",
"@eslint/js": "^9.14.0",
"@json-editor/json-editor": "^2.10.1",
"@rollup/plugin-inject": "^5.0.5",
"@tsconfig/node22": "^22.0.0",
"@types/node": "^22.9.0",
"@vitejs/plugin-vue": "^5.1.4",
Expand Down
2 changes: 0 additions & 2 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
</template>
<script>
import Login from './components/login';
import jquery from 'jquery';
window.$ = window.jQuery = jquery;

export default {
name: 'app',
Expand Down
9 changes: 9 additions & 0 deletions client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';

// Utilities
import { NestFactory } from '@nestjs/core';
import inject from '@rollup/plugin-inject';
import ejs from 'ejs';
import { globSync } from 'fast-glob';
import fs from 'fs';
Expand Down Expand Up @@ -60,6 +61,11 @@ export default async ({ mode }) => {
},
}),
DynamicPublicDirectory(['node_modules/iframe-resizer/js']),
inject({
jQuery: 'jquery',
$: 'jquery',
include: [],
}),
],
define: {
'process.env': {},
Expand All @@ -83,6 +89,9 @@ export default async ({ mode }) => {
},
},
},
optimizeDeps: {
include: ['jquery'],
},
};

if (mode === 'development') {
Expand Down

0 comments on commit cb2205b

Please sign in to comment.