Skip to content

Commit 3e7d570

Browse files
committed
Packaging updates
1 parent f03f014 commit 3e7d570

File tree

5 files changed

+469
-27
lines changed

5 files changed

+469
-27
lines changed

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
# Include the following:
66
!images/
7-
!dist/
7+
!dist/**/*.js
8+
!dist/**/*.css
89
!LICENSE
910
!NOTICE
1011
!package.json

esbuild.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ const esbuild = require('esbuild');
33
const path = require('node:path');
44
const os = require('node:os');
55
const { sassPlugin } = require('esbuild-sass-plugin');
6+
const { dtsPlugin } = require("esbuild-plugin-d.ts");
67

78
/** @typedef {import('esbuild').BuildOptions} BuildOptions */
89

910
const args = process.argv.slice(2);
1011
const CLIWatch = args.includes('--watch');
11-
const CLIDevelopment = CLIWatch || args.includes('--development');
1212

1313
/** @type {BuildOptions} */
1414
const commonConfig = {
1515
bundle: true,
1616
target: ['es2020'],
17-
minify: !CLIDevelopment,
18-
sourcemap: CLIDevelopment,
17+
minify: true,
18+
sourcemap: true
1919
};
2020

21-
const outDir = path.join(__dirname, 'out');
21+
const sourceRoot = path.join(__dirname, 'src');
2222
const debugAdapterRoot = path.join(
2323
__dirname,
2424
'node_modules',
@@ -28,15 +28,24 @@ const debugAdapterRoot = path.join(
2828
/** @type {BuildOptions[]} */
2929
const configurations = [
3030
{
31-
entryPoints: [path.join(outDir, 'extension.js')],
32-
outdir: path.join(__dirname, 'dist'),
31+
entryPoints: [path.join(sourceRoot, 'extension.ts')],
32+
outfile: path.join(__dirname, 'dist', 'extension.cjs.js'),
3333
external: ['vscode'],
3434
format: 'cjs',
3535
platform: 'node',
3636
...commonConfig,
3737
},
3838
{
39-
entryPoints: [path.join(outDir, 'memory', 'client', 'index.js')],
39+
entryPoints: [path.join(sourceRoot, 'extension.ts')],
40+
outfile: path.join(__dirname, 'dist', 'extension.esm.js'),
41+
external: ['vscode'],
42+
plugins: [dtsPlugin()],
43+
format: 'esm',
44+
platform: 'node',
45+
...commonConfig,
46+
},
47+
{
48+
entryPoints: [path.join(sourceRoot, 'memory', 'client', 'index.tsx')],
4049
outfile: path.join(__dirname, 'dist', 'MemoryBrowser.js'),
4150
plugins: [sassPlugin()],
4251
format: 'iife',

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"url": "https://github.com/eclipse-cdt-cloud/cdt-gdb-vscode/issues"
1515
},
1616
"homepage": "https://github.com/eclipse-cdt-cloud/cdt-gdb-vscode#readme",
17-
"main": "./dist/extension",
17+
"main": "./dist/extension.cjs.js",
18+
"module": "./dist/extension.esm.js",
19+
"types": "./dist/extension.d.ts",
1820
"engines": {
1921
"vscode": "^1.78.0"
2022
},
@@ -722,8 +724,6 @@
722724
}
723725
},
724726
"scripts": {
725-
"build:tsc": "tsc -b",
726-
"watch:tsc": "tsc -b -w",
727727
"build:esbuild": "node esbuild.js",
728728
"watch:esbuild": "node esbuild.js --watch",
729729
"build": "run-s build:*",
@@ -755,6 +755,7 @@
755755
"@vscode/vsce": "^2.18.0",
756756
"chai": "^4.3.7",
757757
"esbuild": "^0.19.2",
758+
"esbuild-plugin-d.ts": "^1.1.0",
758759
"esbuild-sass-plugin": "^2.13.0",
759760
"eslint": "^8.35.0",
760761
"event-stream": "^4.0.1",
@@ -772,6 +773,11 @@
772773
"CONTRIBUTING.md",
773774
"dist/**/*.js",
774775
"dist/**/*.js.map",
775-
"dist/**/*.d.ts"
776+
"dist/**/*.css",
777+
"dist/**/*.css.map",
778+
"dist/**/*.d.ts",
779+
"src/**/*.ts",
780+
"src/**/*.tsx",
781+
"src/**/*.scss"
776782
]
777783
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"module": "commonjs",
55
"moduleResolution": "node",
66
"target": "es2015",
7-
"outDir": "out",
7+
"outDir": "dist",
88
"lib": ["es2015", "dom"],
99
"jsx": "react",
1010
"strict": true,

0 commit comments

Comments
 (0)