Skip to content

Commit 78be1b5

Browse files
committed
1 parent ae0ad03 commit 78be1b5

File tree

8 files changed

+654
-988
lines changed

8 files changed

+654
-988
lines changed

gitpod-remote/esbuild.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const esbuild = require("esbuild");
2+
const esbuildSvelte = require("esbuild-svelte");
3+
const sveltePreprocess = require("svelte-preprocess")
4+
const { aliasPath } = require("esbuild-plugin-alias-path")
5+
const path = require("path");
6+
7+
const args = process.argv.slice(2);
8+
9+
const isWatch = args.indexOf('--watch') >= 0;
10+
11+
async function build() {
12+
esbuild.build({
13+
entryPoints: {
14+
portsview: path.join(__dirname, '../gitpod-shared/portsview/src/main.ts'),
15+
codicon: path.join(__dirname, 'node_modules', '@vscode', 'codicons', 'dist', 'codicon.css'),
16+
},
17+
mainFields: ["svelte", "browser", "module", "main"],
18+
bundle: true,
19+
outdir: path.join(__dirname, './public'),
20+
loader: {
21+
'.ttf': 'dataurl',
22+
},
23+
minify: true,
24+
sourcemap: isWatch,
25+
platform: 'browser',
26+
target: ['es2020'],
27+
plugins: [
28+
aliasPath({
29+
alias: { 'package.nls.json': path.join(__dirname, 'package.nls.json') },
30+
}),
31+
esbuildSvelte({
32+
preprocess: sveltePreprocess(),
33+
}),
34+
],
35+
logLevel: "info",
36+
})
37+
}
38+
39+
build().catch((e) => {
40+
console.error(e)
41+
process.exit(1)
42+
});
43+
44+
if (isWatch) {
45+
const watcher = require('@parcel/watcher');
46+
watcher.subscribe(srcDir, () => {
47+
return build();
48+
});
49+
}

gitpod-remote/package.json

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -367,39 +367,31 @@
367367
"webpack": "webpack --mode development",
368368
"compile": "tsc -b",
369369
"watch": "tsc -b -w",
370-
"build:webview": "rollup -c",
371-
"watch:webview": "rollup -c -w",
370+
"build:webview": "node esbuild.js",
371+
"watch:webview": "node esbuild.js --watch",
372372
"start:webview": "sirv public --no-clear",
373373
"package": "npx vsce package --yarn --allow-star-activation"
374374
},
375375
"devDependencies": {
376-
"@typescript-eslint/eslint-plugin": "^5.19.0",
377-
"@typescript-eslint/parser": "^5.19.0",
378-
"@types/webpack": "^5.28.0",
379376
"@tsconfig/svelte": "^2.0.0",
380377
"@types/node": "16.x",
381378
"@types/vscode": "^1.63.0",
382379
"@types/vscode-webview": "^1.57.0",
383-
"rollup": "^2.3.4",
384-
"rollup-plugin-copy": "^3.4.0",
385-
"rollup-plugin-css-only": "^3.1.0",
386-
"rollup-plugin-livereload": "^2.0.0",
387-
"rollup-plugin-svelte": "^7.0.0",
388-
"rollup-plugin-terser": "^7.0.0",
389-
"@rollup/plugin-commonjs": "^17.0.0",
390-
"@rollup/plugin-json": "^4.1.0",
391-
"@rollup/plugin-node-resolve": "^11.0.0",
392-
"@rollup/plugin-typescript": "^8.0.0",
393-
"@rollup/plugin-alias": "^3.1.9",
380+
"@types/webpack": "^5.28.0",
381+
"@typescript-eslint/eslint-plugin": "^5.19.0",
382+
"@typescript-eslint/parser": "^5.19.0",
383+
"esbuild": "^0.17.11",
384+
"esbuild-plugin-alias-path": "^2.0.2",
385+
"esbuild-svelte": "^0.7.3",
386+
"eslint": "^8.13.0",
394387
"sirv-cli": "^2.0.0",
395388
"svelte": "^3.0.0",
396389
"svelte-check": "^2.0.0",
397390
"svelte-preprocess": "^4.0.0",
398-
"eslint": "^8.13.0",
399391
"ts-loader": "^9.2.7",
400392
"typescript": "^4.6.3",
401393
"webpack": "^5.42.0",
402-
"webpack-cli": "^4.7.2"
394+
"webpack-cli": "^4.7.2"
403395
},
404396
"dependencies": {
405397
"gitpod-shared": "link:./../gitpod-shared",

gitpod-remote/rollup.config.js

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)