Skip to content

Watch local dependency sources in dev/watch mode#70

Merged
titouanmathis merged 2 commits intomainfrom
fix/watch-local-deps
Apr 3, 2026
Merged

Watch local dependency sources in dev/watch mode#70
titouanmathis merged 2 commits intomainfrom
fix/watch-local-deps

Conversation

@titouanmathis
Copy link
Copy Markdown
Contributor

Problem

When using local dependencies (with source pointing to local files), PlaygroundDependenciesPlugin compiled them with tsdown during the processAssets hook, but never told webpack to watch those source files. Changes to local dependency sources didn't trigger recompilation in dev/watch mode.

Fix

Register local source files as compilation.fileDependencies in the thisCompilation hook so webpack watches them and triggers rebuilds when they change.

Tests

Added 3 new tests covering file watching behavior:

  • Local source files are added to fileDependencies
  • esm.sh dependencies are not added
  • Bundle deps without source are not added

Register local source files as compilation.fileDependencies so webpack
triggers rebuilds when they change. Previously, tsdown would compile them
once but changes were ignored in dev/watch mode.

Co-authored-by: Claude <claude@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Size Change: 0 B

Total Size: 49.7 kB

ℹ️ View Unchanged
Filename Size
packages/playground-preview/dist/element.js 10 kB
packages/playground-preview/dist/index.js 10 kB
packages/playground/dist/front/css/app.css 4.26 kB
packages/playground/dist/front/js/app.js 139 B
packages/playground/dist/front/js/components/Editor.js 929 B
packages/playground/dist/front/js/components/Editors.js 265 B
packages/playground/dist/front/js/components/EditorVisibility.js 343 B
packages/playground/dist/front/js/components/HeaderSwitcher.js 436 B
packages/playground/dist/front/js/components/HtmlEditor.js 748 B
packages/playground/dist/front/js/components/Iframe.js 1.7 kB
packages/playground/dist/front/js/components/IframeReloader.js 182 B
packages/playground/dist/front/js/components/LayoutReactive.js 616 B
packages/playground/dist/front/js/components/LayoutSwitcher.js 341 B
packages/playground/dist/front/js/components/Playground.js 1.14 kB
packages/playground/dist/front/js/components/Resizable.js 992 B
packages/playground/dist/front/js/components/ResizableCursor.js 298 B
packages/playground/dist/front/js/components/ResizableSync.js 512 B
packages/playground/dist/front/js/components/ScriptEditor.js 520 B
packages/playground/dist/front/js/components/StyleEditor.js 247 B
packages/playground/dist/front/js/components/Switcher.js 334 B
packages/playground/dist/front/js/components/ThemeSwitcher.js 456 B
packages/playground/dist/front/js/create-playground.js 196 B
packages/playground/dist/front/js/loaders/html.js 124 B
packages/playground/dist/front/js/loaders/script.js 124 B
packages/playground/dist/front/js/loaders/style.js 124 B
packages/playground/dist/front/js/store/config.js 468 B
packages/playground/dist/front/js/store/content.js 400 B
packages/playground/dist/front/js/store/header.js 573 B
packages/playground/dist/front/js/store/index.js 109 B
packages/playground/dist/front/js/store/layout.js 606 B
packages/playground/dist/front/js/store/theme.js 516 B
packages/playground/dist/front/js/utils/js/index.js 436 B
packages/playground/dist/front/js/utils/monaco.js 765 B
packages/playground/dist/front/js/utils/resolve-import-map-urls.js 246 B
packages/playground/dist/front/js/utils/storage/AbstractStorageProvider.js 138 B
packages/playground/dist/front/js/utils/storage/FallbackStorageProvider.js 266 B
packages/playground/dist/front/js/utils/storage/index.js 479 B
packages/playground/dist/front/js/utils/storage/LocalStorageProvider.js 254 B
packages/playground/dist/front/js/utils/storage/MemoryStorageProvider.js 206 B
packages/playground/dist/front/js/utils/storage/MultiStorageProvider.js 307 B
packages/playground/dist/front/js/utils/storage/StorageProviderInterface.js 73 B
packages/playground/dist/front/js/utils/storage/SyncedStorageProvider.js 292 B
packages/playground/dist/front/js/utils/storage/URLStorageProvider.js 365 B
packages/playground/dist/front/js/utils/storage/WatchableStore.js 307 B
packages/playground/dist/front/js/utils/storage/ZipStorageProvider.js 271 B
packages/playground/dist/front/js/utils/twig/index.js 435 B
packages/playground/dist/index.js 154 B
packages/playground/dist/lib/plugins/PlaygroundDependenciesPlugin.js 2.31 kB
packages/playground/dist/lib/plugins/PlaygroundLoadersPlugin.js 424 B
packages/playground/dist/lib/presets/html-webpack-script-type-module.js 288 B
packages/playground/dist/lib/presets/playground.js 1.07 kB
packages/playground/dist/lib/presets/production-build.js 261 B
packages/playground/dist/lib/tailwind-config.js 509 B
packages/playground/dist/lib/utils/resolve-dependencies.js 1.25 kB
packages/playground/dist/lib/utils/resolve-public-path.js 283 B
packages/playground/dist/lib/utils/zip.js 310 B
packages/playground/dist/preset.js 190 B
packages/playground/dist/tailwind.js 113 B

compressed-size-action

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 3, 2026

Deploying studiometa-playground with  Cloudflare Pages  Cloudflare Pages

Latest commit: b15c196
Status:⚡️  Build in progress...

View logs

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.81%. Comparing base (af9f5d4) to head (b15c196).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
+ Coverage   26.28%   26.81%   +0.52%     
==========================================
  Files          54       54              
  Lines         970      977       +7     
  Branches      185      187       +2     
==========================================
+ Hits          255      262       +7     
  Misses        702      702              
  Partials       13       13              
Flag Coverage Δ
playground 26.81% <100.00%> (+0.52%) ⬆️
playground-preview 26.81% <100.00%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Claude <claude@anthropic.com>
@titouanmathis titouanmathis merged commit 640ffc4 into main Apr 3, 2026
1 check was pending
@titouanmathis titouanmathis deleted the fix/watch-local-deps branch April 3, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant