Skip to content

Commit a24fa12

Browse files
committed
Allow test only build
1 parent 7bc3628 commit a24fa12

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

esbuild.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const esbuild = require('esbuild');
33

44
const production = process.argv.includes('--production');
55
const watch = process.argv.includes('--watch');
6+
const test = process.argv.includes('--test');
67

78
/**
89
* @type {import('esbuild').Plugin}
@@ -77,11 +78,11 @@ async function buildTests() {
7778
}
7879

7980
async function main() {
80-
const buildTasks = [
81-
buildClient(),
82-
buildServer(),
83-
buildTests()
84-
]
81+
const buildTasks = test ? [] : [
82+
buildClient(),
83+
buildServer(),
84+
];
85+
buildTasks.push(buildTests());
8586
const buildContexts = await Promise.all(buildTasks);
8687

8788
if (watch) {

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@
179179
},
180180
"scripts": {
181181
"vscode:prepublish": "npm run package",
182-
"compile": "npm run check-types && node esbuild.js",
182+
"build": "npm run check-types && node esbuild.js",
183+
"build-test": "node esbuild.js --test",
183184
"check-types": "tsc --noEmit",
184185
"watch": "npm-run-all -p watch:*",
185186
"watch:esbuild": "node esbuild.js --watch",
@@ -188,7 +189,7 @@
188189
"lint": "eslint ./client/src ./server/src --ext .ts,.tsx",
189190
"postinstall": "cd client && npm install && cd ../server && npm install && cd ..",
190191
"textMate": "npx js-yaml client/syntaxes/vba.tmLanguage.yaml > client/syntaxes/vba.tmLanguage.json && npm run tmSnapTest",
191-
"antlr": "npm run antlr4ngPre && npm run antlr4ng && npm run antlr4ngFmt && npm run compile",
192+
"antlr": "npm run antlr4ngPre && npm run antlr4ng && npm run antlr4ngFmt && npm run build",
192193
"antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor -Xlog ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/",
193194
"antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/",
194195
"antlr4ngFmt": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbafmt.g4 -o ./server/src/antlr/out/",
@@ -198,7 +199,7 @@
198199
"tmUnitTest": "vscode-tmgrammar-test ./test/textmate/**/*.vba",
199200
"tmSnapTest": "vscode-tmgrammar-snap ./test/textmate/snapshot/*.??s",
200201
"tmSnapUpdate": "vscode-tmgrammar-snap --updateSnapshot ./test/textmate/snapshot/*.??s",
201-
"vsctest": "vscode-test"
202+
"vsctest": "npm run build-test && vscode-test"
202203
},
203204
"dependencies": {
204205
"antlr4ng": "^3.0.16",

0 commit comments

Comments
 (0)