Fix django-channels import

`django-channels` module has only dist files which are built with
parcel. This leads to `assignment to undeclared variable parcelRequire`
error.

A simple workaround is to add `var parcelRequire;` to the beginning of
the module.
environments/review-front-deve-otr6gc/deployments/10515
Kasper Seweryn 2022-02-21 23:16:48 +01:00
rodzic 80ed06db04
commit a6ce396fa2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B2BA6FA597595C00
1 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -3,11 +3,21 @@
import { defineConfig } from 'vite'
import { createVuePlugin as vue } from "vite-plugin-vue2";
const path = require("path");
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
{
name: 'fix-django-channels',
transform (src, id) {
if (id.includes('django-channels')) {
return `var parcelRequire;${src}`
}
}
}
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),