-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
45 lines (39 loc) · 1.19 KB
/
webpack.config.js
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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
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: 'node',
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'out'),
libraryTarget: "commonjs",
devtoolModuleFilenameTemplate: 'file:///[absolute-resource-path]'
}
};
return merge(baseConfig, config);
}
module.exports = function (env) {
env = env || {};
env.production = !!env.production;
return [
getExtensionConfig(env),
base.getWebviewConfig(env, './src/main.ts', 'main.js')
];
};