Skip to content

Commit 34159e7

Browse files
committed
adding webpack.config.js
1 parent 96a0a43 commit 34159e7

5 files changed

Lines changed: 2640 additions & 168 deletions

File tree

extensions/git/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

extensions/git/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"activationEvents": [
1616
"*"
1717
],
18-
"main": "./out/main",
18+
"main": "./dist/main",
1919
"icon": "resources/icons/git.png",
2020
"scripts": {
2121
"compile": "gulp compile-extension:git",
@@ -912,7 +912,9 @@
912912
"type": "boolean",
913913
"description": "%config.autofetch%",
914914
"default": false,
915-
"tags": ["usesOnlineServices"]
915+
"tags": [
916+
"usesOnlineServices"
917+
]
916918
},
917919
"git.confirmSync": {
918920
"type": "boolean",
@@ -1199,6 +1201,8 @@
11991201
"@types/mocha": "2.2.43",
12001202
"@types/node": "7.0.43",
12011203
"@types/which": "^1.0.28",
1202-
"mocha": "^3.2.0"
1204+
"mocha": "^3.2.0",
1205+
"webpack": "^4.16.5",
1206+
"webpack-cli": "^3.1.0"
12031207
}
1204-
}
1208+
}

extensions/git/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function activate(context: ExtensionContext): Promise<API> {
7777
commands.registerCommand('git.showOutput', () => outputChannel.show());
7878
disposables.push(outputChannel);
7979

80-
const { name, version, aiKey } = require(context.asAbsolutePath('./package.json')) as { name: string, version: string, aiKey: string };
80+
const { name, version, aiKey } = require('../package.json') as { name: string, version: string, aiKey: string };
8181
const telemetryReporter = new TelemetryReporter(name, version, aiKey);
8282
deactivateTasks.push(() => telemetryReporter.dispose());
8383

extensions/git/webpack.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
'use strict';
7+
8+
const path = require('path');
9+
10+
module.exports = {
11+
mode: 'production',
12+
target: 'node',
13+
entry: './out/main.js',
14+
output: {
15+
filename: 'main.js',
16+
path: path.resolve(__dirname, 'dist'),
17+
libraryTarget: "commonjs"
18+
},
19+
externals: {
20+
'vscode': 'commonjs vscode',
21+
},
22+
devtool: 'source-map'
23+
};

0 commit comments

Comments
 (0)