-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
user shouldn't load code that is rarely used
- Loading branch information
Showing
8 changed files
with
63 additions
and
19 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 |
---|---|---|
|
@@ -12,5 +12,6 @@ resources/icons/*-dark | |
resources/icons/*-light | ||
/coverage | ||
*.js | ||
!esbuild.config.js | ||
*.gv |
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 @@ | ||
.github/ | ||
.mocharc.js | ||
esbuild.config.js | ||
.nycrc | ||
.vscode | ||
**/.gitignore | ||
|
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,38 @@ | ||
const esbuild = require('esbuild'); | ||
const minify = process.argv.includes('--minify'); | ||
const sourcemap = process.argv.includes('--sourcemap'); | ||
|
||
function buildConfig(entryPoint, outfile) { | ||
return { | ||
minify, | ||
entryPoints: [entryPoint], | ||
bundle: true, | ||
platform: 'node', | ||
sourcemap, | ||
target: 'node18', | ||
format: 'cjs', | ||
external: ['vscode', './gitExport', './praise'], | ||
...(outfile ? {outfile} : {}), | ||
} | ||
} | ||
|
||
async function main() { | ||
const results = await Promise.all([ | ||
esbuild.build( | ||
{...buildConfig('./src/main.ts', 'out/main.js')} | ||
), | ||
esbuild.build( | ||
{...buildConfig('./src/praise.ts', 'out/praise.js'), external: ['vscode']} | ||
), | ||
esbuild.build( | ||
{...buildConfig('./src/gitExport.ts', 'out/gitExport.js')} | ||
), | ||
esbuild.build( | ||
{...buildConfig('./media/preview.ts', 'media/preview.js'), platform:'browser', format: 'iife'} | ||
), | ||
xxx | ||
]) | ||
console.log('fossil extension js files are ready') | ||
} | ||
|
||
main() |
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