Skip to content

Comments

Bundle bpmn-js assets locally instead of loading from CDN#64

Merged
vobu merged 3 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60
Feb 18, 2026
Merged

Bundle bpmn-js assets locally instead of loading from CDN#64
vobu merged 3 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Addresses feedback from #60 to eliminate runtime internet dependency for diagram rendering by bundling bpmn-js assets with the CLI.

Changes

  • Dependency: Added bpmn-js@18 as production dependency
  • Build: Extended build script to copy bpmn-js assets (bpmn-viewer.production.min.js, CSS, fonts) from node_modules to dist/assets/bpmn-js/
  • Runtime: Modified diagram.ts to use file:// URLs pointing to bundled assets instead of unpkg.com CDN

Implementation

Before:

<link rel="stylesheet" href="https://unpkg.com/bpmn-js@18/dist/assets/bpmn-js.css">
<script src="https://unpkg.com/bpmn-js@18/dist/bpmn-viewer.production.min.js"></script>

After:

const assetsDir = join(__dirname, '..', 'assets', 'bpmn-js');
const cssUrl = `file://${join(assetsDir, 'assets', 'bpmn-js.css')}`;
const jsUrl = `file://${join(assetsDir, 'bpmn-viewer.production.min.js')}`;

Diagram rendering now works offline and in air-gapped/proxied environments.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 18, 2026 14:11
- Add bpmn-js@18 as a dependency
- Update build script to copy bpmn-js assets to dist/assets/bpmn-js/
- Update diagram.ts to use file:// URLs for bundled assets
- Removes hard internet dependency for diagram rendering
- Enables diagram rendering in air-gapped/proxied environments

Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Copilot AI changed the title [WIP] Update bundling approach for PI diagram rendering Bundle bpmn-js assets locally instead of loading from CDN Feb 18, 2026
Copilot AI requested a review from vobu February 18, 2026 14:15
@vobu vobu marked this pull request as ready for review February 18, 2026 14:18
@vobu vobu merged commit a818fd1 into feat/process-instance-diagram Feb 18, 2026
1 check passed
@vobu vobu deleted the copilot/sub-pr-60 branch February 18, 2026 14:18
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.

2 participants