Skip to content

Commit d562838

Browse files
committed
📦Added limboole executables
1 parent 1a987ee commit d562838

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.vscodeignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.github/
12
.vscode/
23
out/**
34
node_modules/**
@@ -11,4 +12,5 @@ vsc-extension-quickstart.md
1112
**/*.map
1213
**/*.ts
1314
**/.vscode-test.*
14-
resources/
15+
resources/
16+
lib/

esbuild.js

+28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const esbuild = require("esbuild");
2+
const fs = require('fs');
3+
const path = require('path');
24

35
const production = process.argv.includes('--production');
46
const watch = process.argv.includes('--watch');
@@ -23,6 +25,31 @@ const esbuildProblemMatcherPlugin = {
2325
},
2426
};
2527

28+
/**
29+
* @type {import('esbuild').Plugin}
30+
*/
31+
const copyLibPlugin = {
32+
name: 'copy-lib',
33+
setup(build) {
34+
build.onEnd(() => {
35+
const srcDir = path.join(__dirname, 'lib');
36+
const destDir = path.join(__dirname, 'dist', 'lib');
37+
38+
if (!fs.existsSync(destDir)) {
39+
fs.mkdirSync(destDir, { recursive: true });
40+
}
41+
42+
fs.readdirSync(srcDir).forEach(file => {
43+
const srcFile = path.join(srcDir, file);
44+
const destFile = path.join(destDir, file);
45+
fs.copyFileSync(srcFile, destFile);
46+
});
47+
48+
console.log('Copied lib directory to dist/lib');
49+
});
50+
}
51+
};
52+
2653
async function main() {
2754
const ctx = await esbuild.context({
2855
entryPoints: [
@@ -40,6 +67,7 @@ async function main() {
4067
plugins: [
4168
/* add to the end of plugins array */
4269
esbuildProblemMatcherPlugin,
70+
copyLibPlugin,
4371
],
4472
});
4573
if (watch) {

0 commit comments

Comments
 (0)