-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundle CLI tool with eslint Also: Update tsconfig target to ES2019 to be in line with Theia #1363
- Loading branch information
Showing
10 changed files
with
287 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules/ | ||
*.log | ||
lib | ||
dist | ||
tsconfig.tsbuildinfo | ||
eslint.xml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const esbuild = require('esbuild'); | ||
|
||
/** @param {import('esbuild').BuildOptions} context. */ | ||
async function doWatch(options) { | ||
const ctx = await esbuild.context(options); | ||
await ctx.watch(); | ||
console.log('Watching for changes...'); | ||
} | ||
|
||
/** @type {import('esbuild').BuildOptions} */ | ||
const opts = { | ||
entryPoints: ['src/cli.ts'], | ||
bundle: true, | ||
outfile: 'dist/cli.js', | ||
platform: 'node', | ||
sourcemap: true, | ||
packages: 'external' | ||
}; | ||
|
||
const production = process.argv.includes('-p') || process.argv.includes('--production'); | ||
if (production) { | ||
opts.minify = true; | ||
opts.sourcemap = false; | ||
} | ||
const watch = process.argv.includes('-w') || process.argv.includes('--watch'); | ||
if (!watch) { | ||
esbuild.build(opts).catch(() => process.exit(1)); | ||
} else { | ||
doWatch(opts); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.