diff --git a/build/esbuild/build.ts b/build/esbuild/build.ts index 3ad1455bbe7..7ca578a6981 100644 --- a/build/esbuild/build.ts +++ b/build/esbuild/build.ts @@ -43,10 +43,6 @@ const commonExternals = [ 'commonjs', 'node:crypto', 'vscode-jsonrpc', // Used by a few modules, might as well pull this out, instead of duplicating it in separate bundles. - // jsonc-parser doesn't get bundled well with esbuild without any changes. - // Its possible the fix is very simple. - // For now, its handled with webpack. - 'jsonc-parser', // Ignore telemetry specific packages that are not required. 'applicationinsights-native-metrics', '@opentelemetry/tracing', @@ -171,6 +167,9 @@ function createConfig( moment: path.join(extensionFolder, 'build', 'webpack', 'moment.js'), 'vscode-jupyter-release-version': path.join(__dirname, releaseVersionScriptFile) }; + if (target === 'desktop') { + alias['jsonc-parser'] = path.join(extensionFolder, 'node_modules', 'jsonc-parser', 'lib', 'esm', 'main.js'); + } return { entryPoints: [source], outfile, diff --git a/build/webpack/webpack.extension.dependencies.config.js b/build/webpack/webpack.extension.dependencies.config.js deleted file mode 100644 index 748f4d0a7aa..00000000000 --- a/build/webpack/webpack.extension.dependencies.config.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -'use strict'; - -const path = require('path'); -const constants = require('../constants'); -const common = require('./common'); -const entryItems = { - // jsonc-parser does not get bundled propertly with esbuild. - [`node_modules/jsonc-parser`]: `./node_modules/jsonc-parser` -}; - -const config = { - mode: 'production', - target: 'node', - context: constants.ExtensionRootDir, - entry: entryItems, - devtool: 'source-map', - node: { - __dirname: false - }, - externals: ['vscode', 'commonjs', 'vscode-jsonrpc'], - plugins: [...common.getDefaultPlugins('dependencies')], - resolve: { - extensions: ['.js'] - }, - output: { - filename: '[name].js', - path: path.resolve(constants.ExtensionRootDir, 'dist'), - libraryTarget: 'commonjs2', - devtoolModuleFilenameTemplate: '../../[resource-path]' - } -}; -// tslint:disable-next-line:no-default-export -exports.default = config; diff --git a/gulpfile.js b/gulpfile.js index 804d0a4fbf6..5c39af5f9d6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -166,13 +166,6 @@ async function buildWebPackForDevOrProduction(configFile, configNameForProductio await spawnAsync('npm', ['run', 'webpack', '--', '--config', configFile, '--mode', 'development'], webpackEnv); } } -gulp.task('webpack-dependencies', async () => { - // No need to build dependencies for web. - if (common.getBundleConfiguration() === common.bundleConfiguration.web) { - return; - } - await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.dependencies.config.js', 'production'); -}); function modifyJson(jsonFile, cb) { const json = fs.readFileSync(jsonFile).toString('utf-8'); diff --git a/package.json b/package.json index 8000a62c422..82ec1536d19 100644 --- a/package.json +++ b/package.json @@ -2094,17 +2094,15 @@ "preprePublishNonBundle": "gulp clean", "updatePackageJsonForBundle": "gulp updatePackageJsonForBundle", "prePublishNonBundle": "npm run compile-no-watch", - "compile": "concurrently \"tsc -watch -p ./\" npm:webpack-dev \"npx tsx build/esbuild/build.ts --watch\"", - "compile-watch-all": "concurrently \"tsc -watch -p ./\" npm:webpack-dev \"npx tsx build/esbuild/build.ts --watch-all\"", - "compile-no-watch": "concurrently npm:compile-out npm:webpack-dev npm:esbuild-all", + "compile": "concurrently \"tsc -watch -p ./\" \"npx tsx build/esbuild/build.ts --watch\"", + "compile-watch-all": "concurrently \"tsc -watch -p ./\" \"npx tsx build/esbuild/build.ts --watch-all\"", + "compile-no-watch": "concurrently npm:compile-out npm:esbuild-all", "compile-out": "tsc -p ./", "compile-web-test": "webpack --mode development --config ./build/webpack/webpack.extension.web.config.js", "compile-web-test-watch": "webpack --mode development --config ./build/webpack/webpack.extension.web.config.js --stats-error-details --watch --progress", "esbuild-all": "npx tsx build/esbuild/build.ts", - "compile-release": "concurrently npm:compile-out npm:esbuild-release npm:webpack-release", + "compile-release": "concurrently npm:compile-out npm:esbuild-release", "esbuild-release": "npx tsx build/esbuild/build.ts --production", - "webpack-dev": "gulp webpack-dependencies", - "webpack-release": "gulp webpack-dependencies", "esbuild-watch": "npx tsx build/esbuild/build.ts --watch", "checkDependencies": "gulp checkDependencies", "postinstall": "npm run download-api && node ./build/ci/postInstall.js",