@ssit-hub/mvp-generate-template
Version:
A beautiful CLI tool to quickly generate MVP project templates with modern frameworks and best practices
26 lines (22 loc) • 581 B
JavaScript
import esbuild from 'esbuild';
const watch = process.argv.includes('--watch');
const isProd = process.env.NODE_ENV === 'production';
const config = {
entryPoints: ['src/index.js'],
bundle: true,
platform: 'node',
target: 'node18',
outfile: 'dist/index.js',
external: [], // Add external dependencies here
sourcemap: !isProd,
minify: isProd,
logLevel: 'info',
};
if (watch) {
const ctx = await esbuild.context(config);
await ctx.watch();
console.log('Watching for changes...');
} else {
await esbuild.build(config);
console.log('Build completed!');
}