Files
azuredatastudio/extensions/notebook/extension.webpack.config.js
Maddy 5be2e01632 Notebook Telemetry initial changes (#13929)
* initial changes

* add ads-telemetry to nb extension

* add aiKey to notebook extension

* add run cell telemetry in cellmodel

* add NbTelemetryAction

* remove source

* remove telemtery for run notebook for now

* fix optional variable call

* addr comments

* changing the dependency package

* revert

* removed webpack config for telemetry compat

* add opentelemetry to externals

Co-authored-by: Benjin Dubishar <benjin.dubishar@gmail.com>
2021-01-25 09:42:37 -08:00

38 lines
1.2 KiB
JavaScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
const withDefaults = require('../shared.webpack.config');
const fs = require('fs');
const path = require('path');
const externals = {
'node-fetch': 'commonjs node-fetch',
'adm-zip': 'commonjs adm-zip',
'applicationinsights-native-metrics': 'commonjs applicationinsights-native-metrics',
'@opentelemetry/tracing': 'commonjs @opentelemetry/tracing'
};
// conditionally add ws if we are going to be running in a node environment
const yarnrcPath = path.join(__dirname, '.yarnrc');
if (fs.existsSync(yarnrcPath)) {
const yarnrc = fs.readFileSync(yarnrcPath).toString();
const properties = yarnrc.split(/\r?\n/).map(r => r.split(' '));
if (properties.find(r => r[0] === 'runtime')[1] === '"node"') {
externals['ws'] = 'commonjs ws';
}
}
module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/extension.ts'
},
externals: externals
});