ClojureScript Template Output Fix#178
Merged
Merged
Conversation
- :app -> resources/public/js (development/watch) - :app-prod -> target/classes/cljsbuild/public/js (release)
Changed the build-cljs function to release the production version of the app instead of the development version. This ensures that the correct build is generated for production deployment.
Changed the build-cljs function to release the app-prod version instead of the default app. This ensures that the production build is correctly generated when the function is called.
This change prevents the resources/public/js/ directory from being tracked by Git, ensuring that generated files and build artifacts do not clutter the repository.
This change adds the `copy-tree` function from `babashka.fs` to the build process in `build.clj`. It also ensures that the output directory is cleaned before copying the compiled files, improving the build process for the application.
This change integrates the copy-tree function to ensure that the compiled JavaScript files are correctly copied to the public directory after building with shadow-cljs. This helps maintain the proper directory structure for the output files.
Collaborator
|
Thanks, that makes sense. Just pushed up a new template with the fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change updates the Kit ClojureScript module template so development and production builds use different Shadow build IDs and output directories.
Generated projects include this in
resources/html/home.html:In development,
/js/app.jsmust be available from project static resources, so the:appbuild should output toresources/public/js.For production packaging, writing release artifacts into
resources/public/jsis not ideal because it mutates source resources. A dedicated production build target should write into a build output directory.What changed
shadow-cljs.edntemplate now has two build IDs::app->resources/public/js(development/watch):app-prod->target/classes/cljsbuild/public/js(release)build.cljtemplate release command now uses:It also removes stale copied JS output before the copy step:
This avoids
FileAlreadyExistsExceptionon repeateduberjarruns (for examplewhen
target/classes/public/js/manifest.ednalready exists from a previous run).The cljs module injection config was updated to append the same
app-prodrelease command into generatedbuild.clj.The base generated
.gitignoretemplate now includes:This keeps transient dev output out of git when running
npx shadow-cljs watch app.