javascript – Node.js and Vite serving JSON file within a routed directory

I’m trying to serve a JSON file within a directory that has been routed through vite.config.js:

import Inspect from 'vite-plugin-inspect';
import { resolve } from 'path';

export default {
    plugins: [Inspect()],
    build: {
        rollupOptions: {
            input: {
                main: resolve(__dirname, 'index.html'),
                sheets: resolve(__dirname, 'apps/sheets/index.html')
            }
        }
    }
}

I want to serve a JSON file through this router, though I’m getting an empty chunk error Generated an empty chunk: "sheetsmanifest". using the following line:

build: {
    rollupOptions: {
        input: {
            ...,
            sheetsmanifest: resolve(__dirname, 'apps/sheets/manifest.json')
        }
    }
}

Read more here: Source link