Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 40 additions & 19 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,29 @@
"presentation": {
"group": "watch",
"echo": true,
"reveal": "silent",
"reveal": "always",
"focus": false,
"panel": "shared"
},
"isBackground": true,
"problemMatcher": "$tsc-watch"
}, {
"problemMatcher": [
{
"pattern": {
"regexp": ""
},
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "\\[watch\\] build started"
},
"endsPattern": {
"regexp": "\\[watch\\] build finished"
}
}
}
]
},
{
"label": "svelte-watch",
"type": "shell",
"command": "npm",
Expand All @@ -31,25 +47,30 @@
"presentation": {
"group": "watch",
"echo": true,
"reveal": "silent",
"reveal": "always",
"focus": false,
"panel": "shared"
},
"isBackground": true,
"problemMatcher": [{
"pattern": {
"regexp": "^\\[!\\]"
},
"severity": "error"
}, {
"base": "$tsc-watch",
"background": {
"activeOnStart": true,
"beginsPattern": "^\\s*\\[\\d{1,2}:\\d{1,2}:\\d{1,2}(?: AM| PM)?\\] Validating project",
"endsPattern": "waiting for changes..."
"problemMatcher": [
{
"pattern": {
"regexp": "^\\[!\\]"
},
"severity": "error"
},
}],
"dependsOn": ["watch"]
{
"base": "$tsc-watch",
"background": {
"activeOnStart": true,
"beginsPattern": "^\\s*\\[\\d{1,2}:\\d{1,2}:\\d{1,2}(?: AM| PM)?\\] Validating project",
"endsPattern": "waiting for changes..."
},
}
],
"dependsOn": [
"watch"
]
},
{
"label": "test",
Expand Down Expand Up @@ -85,7 +106,7 @@
"type": "npm",
"label": "build",
"script": "build",
"dependsOn": "clean",
// "dependsOn": "clean",
"problemMatcher": [],
"group": {
"kind": "build",
Expand All @@ -105,4 +126,4 @@
"problemMatcher": []
}
]
}
}
42 changes: 42 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const esbuild = require('esbuild')
const fsExtra = require('fs-extra');

class Plugin {
constructor() {
this.name = 'empty-loader'
}
setup(build) {
build.onResolve({ filter: /^chokidar$/ }, args => ({
path: args.path,
namespace: 'empty-loader',
}))
build.onLoad({ filter: /.*/, namespace: 'empty-loader' }, () => ({
contents: '/*chokidar is not necessary for the language server so we replaced it with an empty object to fix esbuild issues*/\nmodule.exports = {}',
}))
}
}

esbuild.build({
entryPoints: {
'extension': './src/extension.ts',
'extension-web': './src/extension-web.ts',
'LanguageServerRunner': './src/LanguageServerRunner.ts',
'brighterscript': './node_modules/brighterscript/dist/index.js'
},
bundle: true,
sourcemap: true,
splitting: false, //enable this once esbuild supports commonjs code splitting
treeShaking: true,
watch: process.argv.includes('--watch'),
minify: true, //process.argv.includes('--minify'),
mainFields: ['module', 'main'],
entryNames: '[name]',
outdir: 'dist',
external: [
'vscode'
],
format: 'cjs',
platform: 'node',
logLevel: 'info',
plugins: [new Plugin()]
}).catch((e) => console.error(e));
Loading