Remove the need to use external post processing scripts in python to be able to use this on a ESP32 microcontroller
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
I am currently working on an embedded project that utilizes SvelteKit for the frontend. In this project, we are using SPIFFS (SPI Flash File Storage) to store and manage files.
SPIFFS has certain limitations, such as a really short maximum path length, which leads to a complete failure to build the image for the microcontrollers onboard filesystem.
To address this issue, I've had to resort to a manual Python script to perform the following tasks during the build process:
- Rename files in the
immutabledirectory to a integer. (I probably should have used a hash instead) - Scan trough every file in the solution for the old names of the files and replace them.
This workaround is less than ideal and adds complexity to the build process. It involves additional scripting and introduces room for human error.
Describe the proposed solution
I would like to request an enhancement that allows for customizable output file naming in the SvelteKit Vite plugin.
Vite allows this via the rollupOptions/output/*FileNames config but SvelteKit overrides it, maybe make this option configurable again?
Alternatives considered
As described in the previous messages, I have implemented a manual Python script to handle file naming and path issues during the build process. This involves copying files, renaming them, and ensuring they meet SPIFFS requirements. While this approach works, it adds complexity to the build process and is error-prone.
It was suggested in the SvelteKit Discord community that I could potentially fork the SvelteKit plugin and make modifications to the code to address the file naming issue.
Another alternative considered was modifying the SPIFFS library itself to accommodate longer file paths or folder structures. Both these approaches are not ideal as they involve making changes to an external dependency, which may lead to compatibility issues and maintenance challenges.
Importance
Would make my life ALOT easier, make the project less likely to break and reduce the need for postprocessing scripts in python...
Additional Information
This text has been crafted with the assistance of ChatGPT to simplify and improve the quality of the PR.
I've meticulously reviewed it, ensuring its accuracy and the provision of essential context.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the SvelteKit Vite plugin and reviewing how it configures Rollup output filenames. Determine how customizable asset names and paths should be exposed, then verify that the generated filesystem image no longer requires Python post-processing for ESP32/SPIFFS path limits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, vite
- Domain
- build-system, embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100