This Python script minifies and chunks a SvelteKit project into multiple markdown files. It's designed to help developers work with large SvelteKit projects in AI-assisted development environments by breaking down the project into manageable pieces.
sveltekit_project_minifier.py
script in a convenient location.python sveltekit_project_minifier.py /path/to/sveltekit/project /path/to/output/directory --chunk-size 8000
Replace /path/to/sveltekit/project
with the path to your SvelteKit project, and /path/to/output/directory
with the desired output location for the markdown files.
The --chunk-size
parameter is optional and defaults to 8000 characters. Adjust this value based on the context window size of your AI model.
The script will generate:
index.md
file in the output directory, serving as a table of contents for all chunked files.Create a .sveltekitminifyignore
file in your SvelteKit project root to specify files or directories to ignore. The syntax is similar to .gitignore
.
This script provides basic minification. For production use, consider implementing a more robust minification solution.
Feel free to submit issues or pull requests to improve this script.