From 39c7c5b97f96a0f5851c1fa9d6e1be569ddcbf04 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Thu, 2 Mar 2023 16:29:55 +0100 Subject: [PATCH] Fix VSCode build There were two issues: - One was resolved by following the steps in https://github.com/microsoft/PowerBI-visuals-tools/issues/365#issuecomment-1099716186 - The other one was caused by the .ttf icon in monaco being moved, I changed the rule to now bundle any ttf with the full name (we only have one anyways). --- client/vscode/webpack.config.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/client/vscode/webpack.config.js b/client/vscode/webpack.config.js index 2fe69580f6386..15f7272ef6ffb 100644 --- a/client/vscode/webpack.config.js +++ b/client/vscode/webpack.config.js @@ -91,6 +91,12 @@ function getExtensionCoreConfiguration(targetType) { exclude: /node_modules/, use: [getBabelLoader()], }, + { + test: /\.m?js/, + resolve: { + fullySpecified: false, + }, + }, ], }, plugins: [ @@ -124,8 +130,8 @@ const searchSidebarWebviewPath = path.resolve(webviewSourcePath, 'sidebars', 'se const helpSidebarWebviewPath = path.resolve(webviewSourcePath, 'sidebars', 'help') // Extension Host Worker Path const extensionHostWorker = /main\.worker\.ts$/ -// Monaco Editor Path -const MONACO_EDITOR_PATH = path.resolve(rootPath, 'node_modules', 'monaco-editor') +// Codicons Path +const CODICONS_PATH = path.resolve(rootPath, 'node_modules', '@vscode', 'codicons') /** @type {import('webpack').Configuration}*/ const webviewConfig = { context: __dirname, // needed when running `gulp` from the root dir @@ -215,12 +221,17 @@ const webviewConfig = { // to reference path in the extension when we load the font ourselves. { test: /\.ttf$/, - include: [MONACO_EDITOR_PATH], type: 'asset/resource', generator: { filename: '[name][ext]', }, }, + { + test: /\.m?js/, + resolve: { + fullySpecified: false, + }, + }, ], }, }