Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
node_modules
lib

**/app/bundle.js
**/app/bundle.js.map
**/app/*.bundle.js
**/app/*.bundle.js.map
**/app/*bundle.js
**/app/*bundle.js.map
**/app/*bundle.css
**/app/*bundle.css.map

*.log
*.ttf
Expand Down
2 changes: 2 additions & 0 deletions client/examples/workflow-webapp/app/diagram.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<html>
<head>
<meta charset="utf-8" />
<!-- bundled app styles (extracted by esbuild from the imported CSS) -->
<link rel="stylesheet" href="bundle.css" />
<style>
html,
body {
Expand Down
77 changes: 77 additions & 0 deletions client/examples/workflow-webapp/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/********************************************************************************
* Copyright (c) 2026 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
// @ts-check
const esbuild = require('esbuild');
const path = require('path');

const appRoot = path.resolve(__dirname, 'app');

const args = process.argv.slice(2);
const isWatch = args.includes('--watch');

/**
* Reports the build progress and surfaces errors/warnings in a format that
* VS Code's `$esbuild-watch` problem matcher can pick up.
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',
setup(build) {
build.onStart(() => {
console.log(`${isWatch ? '[watch] ' : ''}build started`);
});
build.onEnd(result => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
if (location) {
console.error(` ${location.file}:${location.line}:${location.column}:`);
}
});
console.log(`${isWatch ? '[watch] ' : ''}build finished`);
});
}
};

/** @type {import('esbuild').BuildOptions} */
const buildOptions = {
entryPoints: [path.resolve(__dirname, 'src', 'app.ts')],
outdir: appRoot,
entryNames: 'bundle', // -> app/bundle.js + app/bundle.css (extracted from the imported CSS)
assetNames: '[name]-[hash]', // -> app/codicon-<hash>.ttf, referenced relatively from bundle.css
bundle: true,
minify: true,
sourcemap: true, // emit .map files alongside the minified bundle so the original sources stay debuggable
format: 'iife', // diagram.html loads bundle.js via a classic <script src>
platform: 'browser',
target: ['es2019'],
logLevel: 'silent',
loader: { '.ttf': 'file' },
plugins: [esbuildProblemMatcherPlugin]
};

async function main() {
if (isWatch) {
const ctx = await esbuild.context(buildOptions);
await ctx.watch();
} else {
await esbuild.build(buildOptions);
}
}

main().catch(error => {
console.error(error);
process.exit(1);
});
16 changes: 5 additions & 11 deletions client/examples/workflow-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"private": true,
"description": "GLSP-based webapp for the Workflow example",
"scripts": {
"bundle": "yarn compile && webpack",
"clean": "rimraf lib tsconfig.tsbuildinfo app/bundle.js app/bundle.js.map",
"bundle": "yarn compile && node ./esbuild.js",
"clean": "rimraf lib tsconfig.tsbuildinfo app/bundle.js app/bundle.js.map app/bundle.css app/bundle.css.map app/*.ttf",
"compile": "tsc -b",
"lint": "eslint ./src",
"test": "mocha --config ../../.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter",
"watch": "webpack -w",
"watch": "node ./esbuild.js --watch",
"watch:tsc": "tsc -w"
},
"dependencies": {
Expand All @@ -19,14 +19,8 @@
},
"devDependencies": {
"@vscode/codicons": "^0.0.25",
"css-loader": "^6.7.3",
"file-loader": "^6.2.0",
"esbuild": "^0.25.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"source-map-loader": "^4.0.1",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.2",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
"rimraf": "^3.0.2"
}
}
58 changes: 0 additions & 58 deletions client/examples/workflow-webapp/webpack.config.js

This file was deleted.

Loading