Skip to content

Commit

Permalink
📦Added limboole executables
Browse files Browse the repository at this point in the history
  • Loading branch information
soaibsafi committed Sep 15, 2024
1 parent 1a987ee commit d562838
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.github/
.vscode/
out/**
node_modules/**
Expand All @@ -11,4 +12,5 @@ vsc-extension-quickstart.md
**/*.map
**/*.ts
**/.vscode-test.*
resources/
resources/
lib/
28 changes: 28 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const esbuild = require("esbuild");
const fs = require('fs');
const path = require('path');

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');
Expand All @@ -23,6 +25,31 @@ const esbuildProblemMatcherPlugin = {
},
};

/**
* @type {import('esbuild').Plugin}
*/
const copyLibPlugin = {
name: 'copy-lib',
setup(build) {
build.onEnd(() => {
const srcDir = path.join(__dirname, 'lib');
const destDir = path.join(__dirname, 'dist', 'lib');

if (!fs.existsSync(destDir)) {
fs.mkdirSync(destDir, { recursive: true });
}

fs.readdirSync(srcDir).forEach(file => {
const srcFile = path.join(srcDir, file);
const destFile = path.join(destDir, file);
fs.copyFileSync(srcFile, destFile);
});

console.log('Copied lib directory to dist/lib');
});
}
};

async function main() {
const ctx = await esbuild.context({
entryPoints: [
Expand All @@ -40,6 +67,7 @@ async function main() {
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
copyLibPlugin,
],
});
if (watch) {
Expand Down

0 comments on commit d562838

Please sign in to comment.