2020-02-06 00:38:34 +03:00
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
//@ts-check
|
|
|
|
|
|
|
|
// See https://github.com/Microsoft/vscode-azuretools/wiki/webpack for guidance
|
|
|
|
|
|
|
|
const process = require('process');
|
2022-02-16 02:35:24 +03:00
|
|
|
const dev = require("@microsoft/vscode-azext-dev");
|
2020-02-06 00:38:34 +03:00
|
|
|
|
|
|
|
let DEBUG_WEBPACK = !/^(false|0)?$/i.test(process.env.DEBUG_WEBPACK || '');
|
|
|
|
|
2023-03-25 00:45:30 +03:00
|
|
|
const config = dev.getDefaultWebpackConfig({
|
2020-02-06 00:38:34 +03:00
|
|
|
projectRoot: __dirname,
|
|
|
|
verbosity: DEBUG_WEBPACK ? 'debug' : 'normal',
|
2024-05-08 01:32:29 +03:00
|
|
|
entries: {
|
|
|
|
// required for cloud shell feature
|
|
|
|
cloudConsoleLauncher: './src/cloudConsole/cloudShellChildProcess/cloudConsoleLauncher.ts',
|
2023-03-25 00:45:30 +03:00
|
|
|
},
|
|
|
|
externals:
|
|
|
|
{
|
|
|
|
// Fix "Module not found" errors in ./node_modules/websocket/lib/{BufferUtil,Validation}.js
|
|
|
|
// These files are not in node_modules and so will fail normally at runtime and instead use fallbacks.
|
|
|
|
// Make them as external so webpack doesn't try to process them, and they'll simply fail at runtime as before.
|
|
|
|
'../build/Release/validation': 'commonjs ../build/Release/validation',
|
|
|
|
'../build/default/validation': 'commonjs ../build/default/validation',
|
|
|
|
'../build/Release/bufferutil': 'commonjs ../build/Release/bufferutil',
|
|
|
|
'../build/default/bufferutil': 'commonjs ../build/default/bufferutil',
|
2024-05-08 01:32:29 +03:00
|
|
|
|
|
|
|
// required for cloud shell feature
|
|
|
|
bufferutil: 'commonjs bufferutil',
|
|
|
|
'utf-8-validate': 'commonjs utf-8-validate',
|
|
|
|
'./platform/openbsd': 'commonjs copy-paste-openbsd',
|
2023-03-25 00:45:30 +03:00
|
|
|
},
|
2024-05-08 01:32:29 +03:00
|
|
|
target: 'node',
|
|
|
|
suppressCleanDistFolder: true,
|
2020-02-06 00:38:34 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
if (DEBUG_WEBPACK) {
|
|
|
|
console.log('Config:', config);
|
|
|
|
}
|
|
|
|
|
2024-05-08 01:32:29 +03:00
|
|
|
module.exports = [config];
|