Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature?]: Configure output directory #1063

Closed
2 tasks done
iainmerrick opened this issue Sep 15, 2023 · 3 comments
Closed
2 tasks done

[Feature?]: Configure output directory #1063

iainmerrick opened this issue Sep 15, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@iainmerrick
Copy link
Contributor

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

Solid Start currently creates writes its output directly to the project directory — .solid for common intermediate outputs, then one or more final outputs depending on the adapter. For example, the CloudFlare Pages adapter uses dist/public and functions. I'd like to be able to put all the output in a different location.

Vite has build.outDir in its config, but that already has the default value "dist" so it would clash with the existing use of dist in solid-start adapters.

I suggest a new optional config on solid-start itself. outDir probably isn't the best name as it would get confused with Vite's build.outDir. Maybe something like solidOutDir?

Examples 🌈

vite.config.js for the CloudFlare example would look like this:

import { defineConfig } from "vite";
import solid from "solid-start/vite";
import cloudflare from "solid-start-cloudflare-pages";

export default defineConfig({
  plugins: [solid({
    solidOutDir: "out", // <--------
    adapter: cloudflare({})
  })],
});

The directory structure would then be:

vite.config.ts
public/
src/
out/
├── .solid/
├── dist/
└── functions/

Motivation 🔦

  • I'd like to keep the project root tidy and avoid polluting it with arbitrary output files.
  • If all the output is contained in a single directory, it's easier to configure tools like Turbo that want to trace build dependencies (vs having to list [".solid/**", "dist/**", "functions/**"] etc in turbo.json)
  • This would also allow out-of-tree builds which are often useful. For example, we could generate multiple outputs with different adapters from the same Solid Start project.
@iainmerrick iainmerrick added the enhancement New feature or request label Sep 15, 2023
@iainmerrick
Copy link
Contributor Author

I'm happy to work on this if it's deemed useful. I got it working via build.outDir in my own fork, then realised that clashed with existing usage so a different design would be needed.

iainmerrick added a commit to iainmerrick/solid-start that referenced this issue Sep 15, 2023
@joshuarossi
Copy link

hmmm, I have something similar. I am trying to set up a gitlab CI/CD process and the public folder is the default for gitlab on where it hosts the gitlab page (github Pages)

I couldn't find where it was defined how that folder works, because I was going to try and rename it so that they don't conflict.

Totally agree it would be nice to expose these settings so we can define where the output goes and where the input comes from...

iainmerrick added a commit to iainmerrick/solid-start that referenced this issue Oct 3, 2023
iainmerrick added a commit to iainmerrick/solid-start that referenced this issue Oct 6, 2023
@ryansolid
Copy link
Member

In setting up for SolidStart's next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed by mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience.

See #1139 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants