Skip to content

Commit

Permalink
feat: bundle typescript lib in web
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Feb 18, 2022
1 parent 6addfcd commit 01e0edd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('esbuild').build({
entryPoints: {
client: './node_modules/@volar/client/out/browserClientMain.js',
// server: './node_modules/@volar/server/out/browser.js',
// server: './node_modules/@volar/server/out/browser.js', // TODO: fix node depends
},
bundle: true,
outdir: './out/browser',
Expand Down
6 changes: 3 additions & 3 deletions packages/server/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import * as vscode from 'vscode-languageserver/browser';
import { createLanguageServer } from './common';
import { configure as configureHttpRequests } from 'request-light';
import httpSchemaRequestHandler from './schemaRequestHandlers/http';
import * as ts from 'typescript/lib/tsserverlibrary'; // bundle typescript lib in web

const messageReader = new vscode.BrowserMessageReader(self);
const messageWriter = new vscode.BrowserMessageWriter(self);
const connection = vscode.createConnection(messageReader, messageWriter);

createLanguageServer(connection, {
loadTypescript(options) {
throw 'loadTypescript';
return {} as any;
return ts; // not support load by user config in web
},
loadTypescriptLocalized(options) {
throw 'loadTypescriptLocalized';
// TODO
},
schemaRequestHandlers: {
http: httpSchemaRequestHandler,
Expand Down

0 comments on commit 01e0edd

Please sign in to comment.