From 78eb4d3e347469d47649c7fea70b738f04af6070 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Fri, 16 Aug 2024 14:00:11 +0100 Subject: [PATCH] Update to load source maps (#608) --- packages/ide-extension/esbuild.js | 6 +++++- packages/webapp/esbuild.js | 17 ++++++++++++++++- pnpm-lock.yaml | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/ide-extension/esbuild.js b/packages/ide-extension/esbuild.js index c86b75cc..d4cbd543 100644 --- a/packages/ide-extension/esbuild.js +++ b/packages/ide-extension/esbuild.js @@ -32,7 +32,11 @@ const buildConfig = { // workaround because vsce doesn't support pnpm (https://github.com/microsoft/vscode-vsce/issues/421) // so it doesn't copy node_modules to vsix. assets: { - from: ['../webapp/dist/guidedAnswers.js', '../webapp/dist/guidedAnswers.css'], + from: [ + '../webapp/dist/guidedAnswers.js', + '../webapp/dist/guidedAnswers.js.map', + '../webapp/dist/guidedAnswers.css' + ], to: ['.'] } }) diff --git a/packages/webapp/esbuild.js b/packages/webapp/esbuild.js index d1f340d4..2dbfa9ca 100644 --- a/packages/webapp/esbuild.js +++ b/packages/webapp/esbuild.js @@ -6,6 +6,20 @@ const postcss = require('postcss'); const cssModulesPlugin = require('esbuild-css-modules-plugin'); const svgrPlugin = require('esbuild-plugin-svgr'); +// from https://github.com/bvaughn/react-virtualized/issues/1212#issuecomment-847759202 workaround for https://github.com/bvaughn/react-virtualized/issues/1632 until it is released. +const resolveFixup = { + name: 'resolve-fixup', + setup(build) { + build.onResolve({ filter: /react-virtualized/ }, async (args) => { + return { + path: require.resolve( + '../../node_modules/.pnpm/react-virtualized@9.22.5_react-dom@16.14.0_react@16.14.0/node_modules/react-virtualized/dist/umd/react-virtualized.js' + ) + }; + }); + } +}; + const buildConfig = { logLevel: 'info', outdir: 'dist', @@ -35,8 +49,9 @@ const buildConfig = { '@sap/guided-answers-extension-webapp' ], plugins: [ + resolveFixup, sassPlugin({ - async transform(source, _ ,filePath) { + async transform(source, _, filePath) { const { css } = await postcss([autoprefixer]).process(source, { from: filePath }); return css; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e85580d..9da638bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3952,6 +3952,7 @@ packages: /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + requiresBuild: true dependencies: once: 1.4.0 dev: true @@ -7621,6 +7622,7 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + requiresBuild: true dev: true /safe-regex-test@1.0.3: @@ -7976,6 +7978,7 @@ packages: /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + requiresBuild: true dependencies: safe-buffer: 5.2.1 dev: true