Skip to content

Commit

Permalink
refactor(core): add basic cli commands support [ckip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bandantonio committed Nov 12, 2023
1 parent c611b8a commit 6ccb6a5
Show file tree
Hide file tree
Showing 12 changed files with 5,588 additions and 2,187 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
bin
dist
coverage
node_modules
node_modules
*.tsbuildinfo\
27 changes: 27 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { argv } from 'node:process';
import * as esbuild from 'esbuild';

const esbuildContext = {
entryPoints: ['src/index.ts'],
external: ['esbuild', 'asciidoctor'],
outfile: `bin/index.cjs`,
platform: 'node',
logLevel: 'info',
bundle: true,
minify: true,
metafile: true,
};

const isProductionMode = (argv[3] === 'production');

if (!isProductionMode) {
const ctx = await esbuild.context(esbuildContext);

await ctx.watch();
} else {
await esbuild.build(esbuildContext)
.then(() => {
console.log('Bundling completed successfully!');
})
.catch(() => process.exit(1));
}
47 changes: 0 additions & 47 deletions esbuild.config.ts

This file was deleted.

Loading

0 comments on commit 6ccb6a5

Please sign in to comment.