Skip to content

Commit

Permalink
Update to load source maps (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinea authored Aug 16, 2024
1 parent 3e23fb6 commit 78eb4d3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/ide-extension/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: ['.']
}
})
Expand Down
17 changes: 16 additions & 1 deletion packages/webapp/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78eb4d3

Please sign in to comment.