diff --git a/packages/cli/webpack/webpack.ts b/packages/cli/webpack/webpack.ts index bb26f354..e0667f07 100644 --- a/packages/cli/webpack/webpack.ts +++ b/packages/cli/webpack/webpack.ts @@ -9,8 +9,7 @@ import * as packageJson from '../package.json'; const packageExternals = [ 'vscode', 'vscode-languageclient', - 'electron', - 'canvas' + 'electron' ]; const contextFolder = path.resolve(__dirname, '..'); @@ -102,6 +101,10 @@ const common : webpack.Configuration = { }, plugins: [ new WatchMarkersPlugin(), + new webpack.IgnorePlugin({ + resourceRegExp: /^canvas$/, + contextRegExp: /jsdom$/, + }), new webpack.DefinePlugin({ __webpack_build_info__: JSON.stringify({ version: packageJson.version, diff --git a/packages/vscode-extension/webpack/webpack.common.ts b/packages/vscode-extension/webpack/webpack.common.ts index 9d4fb5fb..300329c4 100644 --- a/packages/vscode-extension/webpack/webpack.common.ts +++ b/packages/vscode-extension/webpack/webpack.common.ts @@ -17,8 +17,7 @@ const packageExternals = [ // VSCode is an external that we do not want to package 'vscode', 'vscode-languageclient', - 'electron', - 'canvas' + 'electron' ]; const contextFolder = path.resolve(__dirname, '..'); @@ -98,7 +97,11 @@ const common : webpack.Configuration = { devtoolModuleFilenameTemplate: '[absolute-resource-path]' }, plugins: [ - new WatchMarkersPlugin() + new WatchMarkersPlugin(), + new webpack.IgnorePlugin({ + resourceRegExp: /^canvas$/, + contextRegExp: /jsdom$/, + }) ], node: { __dirname: false, @@ -162,7 +165,7 @@ const common : webpack.Configuration = { externals: function({ request }, callback) { const isExternal = packageExternals.some( moduleName => request && new RegExp(`^${moduleName}(/|$)`, 'i').test(request) - ); + ) if (isExternal){ // @ts-ignore return callback(undefined, `commonjs ${request}`);