Skip to content

Commit

Permalink
chore(vscode): update tasks
Browse files Browse the repository at this point in the history
- Creates some build and watch tasks
- Removed invalid task
- Update `build_themes.js` to run async and support watch mode (watch mode cannot run using `esbuild.buildSync()`)
  • Loading branch information
boneskull committed Dec 29, 2022
1 parent d48fe79 commit e2d5452
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 16 deletions.
77 changes: 71 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,81 @@
"version": "2.0.0",
"tasks": [
{
"label": "build",
"label": "build-tsc",
"type": "npm",
"script": "build:tsc",
"problemMatcher": ["$tsc"],
"detail": "Build TypeDoc w/ tsc",
"presentation": {
"group": "build",
"panel": "dedicated"
},
"group": {
"kind": "build"
}
},
{
"label": "build-themes",
"type": "npm",
"script": "build:themes",
"problemMatcher": ["$esbuild"],
"detail": "Build TypeDoc themes",
"presentation": {
"group": "build",
"panel": "dedicated"
},
"group": {
"kind": "build"
}
},
{
"label": "dev-build-tsc",
"type": "shell",
"command": "npm run build",
"problemMatcher": ["$tsc"]
"command": "npm run build:tsc -- --watch",
"problemMatcher": ["$tsc-watch"],
"detail": "Build TypeDoc w/ tsc in watch mode",
"isBackground": true,
"presentation": {
"group": "dev",
"panel": "dedicated"
},
"group": {
"kind": "build"
}
},
{
"label": "build_and_test",
"label": "dev-build-themes",
"type": "shell",
"command": "npm run build_and_test",
"problemMatcher": ["$tsc"]
"command": "npm run build:themes -- --watch",
"problemMatcher": ["$esbuild-watch"],
"detail": "Build TypeDoc themes in watch mode",
"isBackground": true,
"presentation": {
"group": "dev",
"panel": "dedicated"
},
"group": {
"kind": "build"
}
},
{
"label": "dev",
"dependsOn": ["dev-build-tsc", "dev-build-themes"],
"detail": "Build TypeDoc in watch mode",
"problemMatcher": [],
"group": {
"kind": "build"
}
},
{
"label": "build",
"dependsOn": ["build-tsc", "build-themes"],
"detail": "Build TypeDoc",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
26 changes: 16 additions & 10 deletions scripts/build_themes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
const esbuild = require("esbuild");

esbuild.buildSync({
entryPoints: ["src/lib/output/themes/default/assets/bootstrap.ts"],
bundle: true,
minify: true,
outfile: "static/main.js",
banner: {
js: '"use strict";',
},
logLevel: "info",
});
esbuild
.build({
entryPoints: ["src/lib/output/themes/default/assets/bootstrap.ts"],
bundle: true,
minify: true,
outfile: "static/main.js",
banner: {
js: '"use strict";',
},
logLevel: "info",
watch: process.argv.slice(2).includes("--watch"),
})
.catch((err) => {
console.error(err);
process.exitCode = 1;
});

0 comments on commit e2d5452

Please sign in to comment.