如何在 Vue Quasar 中自定义构建文件位置

how to customize build file locations in Vue Quasar

我需要更改 Vue Quasar 应用程序中的默认构建文件位置。

现在是这样的:

但我需要这个:

我一直在玩 Django 和 Quasar,我一直在寻找类似的东西,想将 index.html 放在 Django 模板文件夹中,将 js/css 放在静态文件夹中。似乎 quasar.conf.js 配置文件中的 build.htmlFilename 允许的不仅仅是名称,还可以包括路径导航。我尝试了以下方法,对我来说效果很好。我在静态文件夹中获取了所有资产,在模板文件夹中获取了 index.html。

module.exports = configure(function (ctx) {
    return {
        ...
        build: {
            vueRouterMode: 'hash',
            distDir: '../mainapp/static/mainapp/quasar/', 
            htmlFilename: '../../../templates/mainapp/quasar/index.html', 
            ...
        }
    }
});

在你的情况下,你可以尝试这样的事情:

module.exports = configure(function (ctx) {
    return {
        ...
        build: {
            vueRouterMode: 'hash',
            
            distDir: 'everything', 
            htmlFilename: '../index.html', 
            ...
        }
    ...
    }
});