Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

Problem

Static source files (fonts, SVGs, sample images) were incorrectly located in dist/assets/, which is meant for build outputs only. This created confusion about what files are source assets vs. generated artifacts, and required complex .gitignore rules to track specific subdirectories within dist/.

Solution

Moved all static assets to a new root-level assets/ directory, leaving only generated files (spritemaps) in dist/assets/. The dist/ folder now exclusively contains actual build outputs.

Changes Made

New Structure:

assets/                        # Static source files (tracked in git)
├── fonts/                     # Font files (Helvetica, Inter)
├── svg/                       # SVG icons (70+ files)
├── sample-images/             # Sample JPEG images (200+ files)
└── samples/                   # Widget loader examples

dist/                          # Build outputs only (gitignored)
├── assets/spritemaps/         # Generated sprite files
└── [widget-name]/             # Compiled widget files

Code Updates:

  • esbuild.js: Updated SVG source path from dist/assets/svg to assets/svg
  • express.ts: Added static middleware to serve files from the new assets/ directory
  • serverless.ts: Added assets/**/* to Lambda package includes
  • .gitignore: Simplified by removing special tracking rules for dist/assets/
  • deployment workflow: Added separate S3 sync for the assets/ folder

Backward Compatibility

All assets remain accessible at the same URLs (/assets/*), ensuring no breaking changes for existing widgets or deployments.

Testing

  • ✅ Build completes successfully
  • ✅ All asset types accessible via HTTP (SVG, fonts, images, spritemaps)
  • ✅ Development server works correctly
  • ✅ Linting and TypeScript compilation pass
  • ✅ 305 files properly moved and tracked in git

The dist/ folder now clearly represents build artifacts only, while assets/ contains the source files that should be version controlled.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Move static assets outside of dist folder, except for those that are actually dist files.

Make sure they are delivered in the same way.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

- Created assets/ directory at root level for static assets
- Moved fonts, sample-images, samples, and svg from dist/assets/ to assets/
- Updated esbuild.js to read SVGs from new location
- Updated express.ts to serve assets from new location
- Updated serverless.ts to include assets in package
- Updated .gitignore to remove old dist/assets tracking
- Updated deployment workflow to sync assets separately
- Verified all assets are accessible via HTTP
- Generated spritemaps remain in dist/assets/spritemaps/

Co-authored-by: oliverkuchies <11084292+oliverkuchies@users.noreply.github.com>
Copilot AI changed the title [WIP] Move static assets outside of dist folder Move static assets outside of dist folder Oct 20, 2025
Copilot finished work on behalf of oliverkuchies October 20, 2025 01:38
Copilot AI requested a review from oliverkuchies October 20, 2025 01:38
@oliverkuchies oliverkuchies marked this pull request as ready for review October 20, 2025 02:23
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 02:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants