Skip to content

Commit

Permalink
Use webpack for building the vsix package
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Oct 19, 2019
1 parent 470e052 commit 3eccea8
Show file tree
Hide file tree
Showing 15 changed files with 372 additions and 41 deletions.
28 changes: 19 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
"outFiles": [
"${workspaceRoot}/client/dist/**/*.js"
],
"preLaunchTask": "npm: watch"
},
{
Expand All @@ -19,13 +23,15 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test",
"${workspaceRoot}/client/testFixture"
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/dist/test",
"${workspaceRoot}/client/testFixture"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"]
"outFiles": [
"${workspaceRoot}/client/dist/test/**/*.js"
]
},
{
"type": "node",
Expand All @@ -35,7 +41,9 @@
"protocol": "inspector",
"port": 6011,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/server/out/**/*.js"]
"outFiles": [
"${workspaceRoot}/server/dist/**/*.js"
]
},
{
"type": "node",
Expand All @@ -45,7 +53,9 @@
"protocol": "inspector",
"port": 6012,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/server/out/**/*.js"]
"outFiles": [
"${workspaceRoot}/server/dist/**/*.js"
]
}
]
}
}
8 changes: 8 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode
*/node_modules
**/out/
**/src/
**/tsconfig.json
**/webpack.config.js
**/tslint.json
test
9 changes: 6 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "existdb-vscode-client",
"version": "1.0.0",
"description": "Visual Studio Code client for eXistdb/XQuery",
"main": "index.js",
"main": "dist/extension.js",
"scripts": {
"update-vscode": "vscode-install",
"postinstall": "vscode-install"
"postinstall": "vscode-install",
"clean": "rimraf ./out ./dist",
"webpack": "webpack --mode production --config ./webpack.config.js",
"webpack-dev": "webpack --mode development --config ./webpack.config.js"
},
"keywords": [
"xquery",
Expand All @@ -27,4 +30,4 @@
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9"
}
}
}
7 changes: 4 additions & 3 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
LanguageClient, LanguageClientOptions, TransportKind
} from 'vscode-languageclient';

const BINARIES_DIR = 'dist';

let defaultClient: LanguageClient;
let clients: Map<string, LanguageClient> = new Map();

Expand Down Expand Up @@ -49,9 +51,8 @@ let taskProvider: Disposable | undefined;
let syncScript;

export function activate(context: ExtensionContext) {

let syncScript = context.asAbsolutePath(path.join('sync', 'out', 'sync.js'));
let module = context.asAbsolutePath(path.join('server', 'out', 'server.js'));
let syncScript = context.asAbsolutePath(path.join('sync', BINARIES_DIR, 'sync.js'));
let module = context.asAbsolutePath(path.join('server', BINARIES_DIR, 'server.js'));
let outputChannel: OutputChannel = Window.createOutputChannel('eXistdb Language Server');

function didOpenTextDocument(document: TextDocument): void {
Expand Down
14 changes: 9 additions & 5 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"rootDir": "src",
"outDir": "dist",
"sourceMap": true
},
"include": ["src"],
"exclude": ["node_modules", ".vscode-test"]
}
"include": [
"src"
],
"exclude": [
"node_modules",
".vscode-test"
]
}
Loading

0 comments on commit 3eccea8

Please sign in to comment.