Quasar CLI with Vite
Django
Expected to have Django serving 'Index.html' and other static files build by 'quasar build' command.
Which resides in "application/dist" and "application/dist/assets" directories.
================================================================
build: {
publicPath: "/<your-django-app>", // <-- e.g. https://your-domain.com/django-app/dist-dir
distDir: "dist", // <-- depends on your setup, you can leave it to
// default, but then you have to configure your
// paths below according to this path.
extendViteConf(viteConf) {
viteConf.base = "/static/your-django-app/dist/";
viteConf.build.polyfillModulePreload = true; // <-- suggested by *https://v2.vitejs.dev/config/#build-polyfillmodulepreload*
viteConf.build.outDir = "dist"; //<-- default value
viteConf.build.assetsDir = "assets"; // <-- default value
}
}
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = [
os.path.join("static"),
os.path.join("static/<your-django-app>/dist/assets"),
]