SolidJSS
SolidJS14mo ago
4 replies
Jason.json

Project Structure and Build Output Configuration

Hi there,

I need assistance with configuring my project to build the output folder one directory above the current level. This setup is necessary due to hosting requirements. Specifically, my hosting provider mandates that the main JavaScript file
(app.js)
and
package.json
be located in the same directory, with the type field in
package.json
set to
commonjs
.

Here’s the structure I aim to achieve:

public_nodejs/  <- Main folder used by hosting to find app.js file

├── app.js      <- Main file pointing to .output directory
├── package.json
├── my_app_dir/ <- Source files
└── .output/    <- Build output


I want to maintain a package.json with type: "module" for building my project and then eject it one folder above. I am using pnpm for package management.

My current app configuration looks like this:

import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
  ssr: true,
  server: {
    preset: "node-server",
    externals: {
      traceOptions: {
        base: process.cwd(),
      },
    },
  },
});


Could you please help me adjust the configuration to achieve this setup?
Was this page helpful?