-
Notifications
You must be signed in to change notification settings - Fork 39
fix(atomic): fix build to include missing assets in CDN #6772
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a build order issue where the sparkles.svg asset was missing from the CDN bundle, causing the atomic-insight-generate-answer-button component to fail with a 404 error. The fix moves the asset preparation scripts (copy-assets.mjs and list-assets.mjs) earlier in the build:stencil-lit script execution, ensuring assets are available before the rollup bundler copies them to the CDN directory.
Key Changes
- Inlined
node ./scripts/copy-assets.mjs && node ./scripts/list-assets.mjsinto thebuild:stencil-litscript, positioning them before therollup -c rollup.config.jsstep - This ensures
sparkles.svgand other assets are copied todist/atomic/assets/before rollup attempts to bundle them into the CDN
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Marking as draft because of the disclaimer:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it works, I'm all for it, but it's hard to know it's the best solution with the existing build process.
But to me it looks good
louis-bompart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, tho questions/changes to be addressed before moving up
SFINT-6534
IN THIS PR:
Trying to use the atomic-insight-generate-answer button in an atomic page is giving the following error:
The issue:
The build order seems to call the rollup script that copies the assets for the CDN before the assets are loaded/copied in the
build:stencil-litscript.We call
build:stencil-litwhich includes therollup -c rollup.config.jswhich copies the assets for the CDN, but then thebuild:copy-assets&build:list-assetswhich loads and saves thesparkles.svgare not yet called. So the CDN does not include the svg.The solution:
Main Changes in turbo.json:
Why:
This enforces the required build order:
Additional Cleanups:
Main Changes in package.json:
Why:
Proof it works:
The CDN without the fix:

The CDN with the fix:
