mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +00:00
* remove prefix from codeowners * remove references from ignore files * Remove prefix from package json and tests * Add run js without prefixes * Rename package folders * Delete auto generated test files * Remove now-node in integration test * Put back deleted vercel json files * Remove eol * Add styfle suggestion to comment in utils/run.js Co-authored-by: Steven <steven@ceriously.com>
31 lines
694 B
JavaScript
31 lines
694 B
JavaScript
#!/usr/bin/env node
|
|
const fs = require('fs-extra');
|
|
const execa = require('execa');
|
|
const { join } = require('path');
|
|
|
|
async function main() {
|
|
const outDir = join(__dirname, 'dist');
|
|
|
|
// Start fresh
|
|
await fs.remove(outDir);
|
|
|
|
// Compile TypeScript
|
|
await execa('tsc', [], { stdio: 'inherit' });
|
|
|
|
// Run `ncc`
|
|
const mainDir = join(outDir, 'main');
|
|
await execa('ncc', ['build', 'src/index.ts', '-o', mainDir], {
|
|
stdio: 'inherit',
|
|
});
|
|
// Move compiled ncc file to out dir
|
|
await fs.rename(join(mainDir, 'index.js'), join(outDir, 'index.js'));
|
|
|
|
// Delete leftover "main" dir
|
|
await fs.remove(mainDir);
|
|
}
|
|
|
|
main().catch(err => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|