-
Notifications
You must be signed in to change notification settings - Fork 30.7k
/
Copy pathextension.webpack.config.js
46 lines (41 loc) · 1.35 KB
/
extension.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
46
/*---------------------------------------------------------------------------------------------
* 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 withDefaults = require('../shared.webpack.config');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const isWindows = process.platform === 'win32';
module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/extension.ts'
},
externals: {
// The @azure/msal-node-runtime package requires this native node module (.node).
// It is currently only included on Windows, but the package handles unsupported platforms
// gracefully.
'./msal-node-runtime': 'commonjs ./msal-node-runtime'
},
resolve: {
alias: {
'keytar': path.resolve(__dirname, 'packageMocks', 'keytar', 'index.js')
}
},
plugins: [
...withDefaults.nodePlugins(__dirname),
new CopyWebpackPlugin({
patterns: [
{
// The native files we need to ship with the extension
from: '**/dist/msal*.(node|dll)',
to: '[name][ext]',
// These will only be present on Windows for now
noErrorOnMissing: !isWindows
}
]
})
]
});