带有 Vite 的 Quasar CLI
Django
预计 Django 服务 'Index.html' 和其他由 'quasar build' 命令构建的静态文件。
驻留在“application/dist”和“application/dist/assets”目录中。
================================================= ===============
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"),
]