laiso / site2pdf

Generate comprehensive PDFs of entire websites, ideal for RAG.
MIT License
175 stars 8 forks source link

without relying on tsx dependency #13

Closed laiso closed 2 weeks ago

laiso commented 2 weeks ago

package.json updates:

Modified the start script to run the built JavaScript file. Updated the dev script to use tsx in watch mode. Added a build script to compile TypeScript files. Added typescript as a dependency and organized dependencies for ts-node and tsx. tsconfig.json updates:

Changed the module option to esnext to enable import.meta. Set noEmit to false to output compiled files. Configured outDir to dist to output compiled files to the dist directory. src/index.ts updates:

Added logic to check if the script is run directly using import.meta. These changes establish a workflow where TypeScript files are built and then executed, and during development, tsx can be used in watch mode.

To verify that this PR works correctly, run the following commands:

Additionally, during development, you can use the following command to run in watch mode: