mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Esbuild package headless
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
!lib/**/*.js
|
||||
!lib/**/*.js.map
|
||||
|
||||
!lib/**/*.mjs
|
||||
!lib/**/*.mjs.map
|
||||
|
||||
!lib/**/*.css
|
||||
|
||||
# Whitelist - src/
|
||||
|
||||
+31
-20
@@ -12,6 +12,7 @@ const config = {
|
||||
isProd: argv.includes('--prod'),
|
||||
isWatch: argv.includes('--watch'),
|
||||
isDemoClient: argv.includes('--demo-client'),
|
||||
isHeadless: argv.includes('--headless'),
|
||||
addon: argv.find(e => e.startsWith('--addon='))?.replace(/^--addon=/, ''),
|
||||
};
|
||||
|
||||
@@ -120,25 +121,7 @@ if (config.addon) {
|
||||
if (config.addon === 'serialize') {
|
||||
bundleConfig.tsconfig = 'addons/addon-serialize/src/tsconfig.json'
|
||||
}
|
||||
} else {
|
||||
bundleConfig = {
|
||||
...bundleConfig,
|
||||
entryPoints: [`src/browser/public/Terminal.ts`],
|
||||
outfile: `lib/xterm.mjs`
|
||||
};
|
||||
outConfig = {
|
||||
...outConfig,
|
||||
entryPoints: ['src/**/*.ts'],
|
||||
outdir: 'out-esbuild/'
|
||||
};
|
||||
// outTestConfig = {
|
||||
// ...outConfig,
|
||||
// entryPoints: ['test/**/*.ts'],
|
||||
// outdir: 'out-esbuild-test/'
|
||||
// };
|
||||
}
|
||||
|
||||
if (config.isDemoClient) {
|
||||
} else if (config.isDemoClient) {
|
||||
bundleConfig = {
|
||||
...bundleConfig,
|
||||
entryPoints: [`demo/client.ts`],
|
||||
@@ -167,7 +150,35 @@ if (config.isDemoClient) {
|
||||
"@xterm/addon-ligatures": "./addons/addon-ligatures/out-esbuild/LigaturesAddon",
|
||||
}
|
||||
}
|
||||
};
|
||||
} else if (config.isHeadless) {
|
||||
bundleConfig = {
|
||||
...bundleConfig,
|
||||
entryPoints: [`src/headless/public/Terminal.ts`],
|
||||
outfile: `headless/lib-headless/xterm-headless.mjs`
|
||||
};
|
||||
outConfig = {
|
||||
...outConfig,
|
||||
entryPoints: ['src/**/*.ts'],
|
||||
outdir: 'out-esbuild/'
|
||||
};
|
||||
skipOut = true;
|
||||
} else {
|
||||
bundleConfig = {
|
||||
...bundleConfig,
|
||||
entryPoints: [`src/browser/public/Terminal.ts`],
|
||||
outfile: `lib/xterm.mjs`
|
||||
};
|
||||
outConfig = {
|
||||
...outConfig,
|
||||
entryPoints: ['src/**/*.ts'],
|
||||
outdir: 'out-esbuild/'
|
||||
};
|
||||
// outTestConfig = {
|
||||
// ...outConfig,
|
||||
// entryPoints: ['test/**/*.ts'],
|
||||
// outdir: 'out-esbuild-test/'
|
||||
// };
|
||||
}
|
||||
|
||||
if (config.isWatch) {
|
||||
context(bundleConfig).then(e => e.watch());
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
!lib-headless/**/*.js
|
||||
!lib-headless/**/*.js.map
|
||||
|
||||
!lib-headless/**/*.mjs
|
||||
!lib-headless/**/*.mjs.map
|
||||
|
||||
!lib-headless/**/*.css
|
||||
|
||||
# Whitelist - src/
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@xterm/headless",
|
||||
"description": "A headless terminal component that runs in Node.js",
|
||||
"version": "5.5.0",
|
||||
"main": "lib-headless/xterm-headless.js",
|
||||
"module": "lib/xterm.mjs",
|
||||
"types": "typings/xterm-headless.d.ts",
|
||||
"repository": "https://github.com/xtermjs/xterm.js",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"command-line",
|
||||
"console",
|
||||
"pty",
|
||||
"shell",
|
||||
"ssh",
|
||||
"styles",
|
||||
"terminal-emulator",
|
||||
"terminal",
|
||||
"tty",
|
||||
"vt100",
|
||||
"webgl",
|
||||
"xterm"
|
||||
]
|
||||
}
|
||||
@@ -40,6 +40,7 @@
|
||||
"esbuild-watch": "node bin/esbuild_all.mjs --watch",
|
||||
"esbuild-package": "node bin/esbuild_all.mjs --prod",
|
||||
"esbuild-package-watch": "node bin/esbuild_all.mjs --prod --watch",
|
||||
"esbuild-package-headless-only": "node bin/esbuild.mjs --prod --headless",
|
||||
"esbuild-demo": "node bin/esbuild.mjs --demo-client",
|
||||
"esbuild-demo-watch": "node bin/esbuild.mjs --demo-client --watch",
|
||||
|
||||
@@ -69,6 +70,7 @@
|
||||
"prepackage": "npm run build",
|
||||
"package": "webpack",
|
||||
"postpackage":"npm run esbuild-package",
|
||||
"prepackage-headless": "npm run esbuild-package-headless-only",
|
||||
"package-headless": "webpack --config ./webpack.config.headless.js",
|
||||
"postpackage-headless": "node ./bin/package_headless.js",
|
||||
"prepublishOnly": "npm run package"
|
||||
|
||||
Reference in New Issue
Block a user