forked from microsoft/vscode-pull-request-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.webpack.config.js
More file actions
58 lines (50 loc) · 1.75 KB
/
Copy pathbrowser.webpack.config.js
File metadata and controls
58 lines (50 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const path = require('path');
const webpack = require('webpack');
const base = require('./base.webpack.config.js');
const merge = require('merge-options');
/**
*
* @param {*} env
* @returns webpack.Configuration
*/
function getExtensionConfig(env) {
const baseConfig = base.getExtensionConfig(env);
/** @type webpack.Configuration */
const config = {
target: 'webworker',
node: {
path: true
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'dist', 'browser'),
libraryTarget: 'commonjs',
},
resolve: {
alias: {
'node-fetch': 'cross-fetch',
'vscode-extension-telemetry': path.resolve(__dirname, 'src/env/browser/vscode-extension-telemetry.js'),
'../env/node/net': path.resolve(__dirname, 'src/env/browser/net'),
'../env/node/ssh': path.resolve(__dirname, 'src/env/browser/ssh'),
'./env/node/gitProviders/api': path.resolve(__dirname, 'src/env/browser/gitProviders/api')
}
}
};
return merge(baseConfig, config);
}
module.exports = function (env) {
env = env || {};
env.production = !!env.production;
return [
getExtensionConfig(env),
base.getWebviewConfig(env, './webviews/editorWebview/index.ts', 'webviewIndex.js'),
base.getWebviewConfig(env, './webviews/activityBarView/index.ts', 'activityBar-webviewIndex.js'),
base.getWebviewConfig(env, './webviews/createPullRequestView/index.ts', 'createPR-webviewIndex.js')
];
};