Fix jQuery in fomantic-ui-css

This commit is contained in:
Kasper Seweryn 2022-02-22 12:34:54 +01:00
parent b2dc70cf3a
commit 5e24160375
No known key found for this signature in database
GPG Key ID: B2BA6FA597595C00
3 changed files with 13 additions and 3 deletions

2
front/src/jquery.js vendored
View File

@ -1,2 +0,0 @@
import jQuery from 'jquery'
window.$ = window.jQuery = jQuery

View File

@ -19,7 +19,6 @@ import filters from '@/filters' // eslint-disable-line
import { parseAPIErrors } from '@/utils'
import globals from '@/components/globals' // eslint-disable-line
import './registerServiceWorker'
import '@/jquery'
import '@/semantic'
logger.default.info('Loading environment:', import.meta.env.NODE_ENV)

View File

@ -9,6 +9,14 @@ import path from 'path'
export default defineConfig({
plugins: [
vue(),
{
name: 'fix-fomantic-ui-css',
transform (src, id) {
if (id.includes('fomantic-ui-css') && id.endsWith('.min.js')) {
return `import jQuery from 'jquery';${src}`
}
}
},
{
name: 'fix-django-channels',
transform (src, id) {
@ -18,6 +26,11 @@ export default defineConfig({
}
}
],
build: {
// NOTE: For debugging builds
// TODO: Remove before #1664 is merged
sourcemap: 'inline'
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),