From 56129a40d025a3986b6f19943659417fa28b706c Mon Sep 17 00:00:00 2001 From: Cody Leff Date: Wed, 12 Oct 2022 21:32:31 -0600 Subject: [PATCH] fix(plugin-chart-handlebars): Update webpack/babel config to fix build/runtime warnings/errors (#21779) (cherry picked from commit d5b4bdeb72e558e78d80e0fdb47249467cb14f03) --- superset-frontend/babel.config.js | 6 ++++++ superset-frontend/webpack.config.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/superset-frontend/babel.config.js b/superset-frontend/babel.config.js index 11bed49eee23b..095c5836cf00f 100644 --- a/superset-frontend/babel.config.js +++ b/superset-frontend/babel.config.js @@ -103,4 +103,10 @@ module.exports = { plugins: [], }, }, + overrides: [ + { + test: './plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/*', + sourceType: 'unambiguous', + }, + ], }; diff --git a/superset-frontend/webpack.config.js b/superset-frontend/webpack.config.js index ac0b9b40f6a21..dd61f35b511a3 100644 --- a/superset-frontend/webpack.config.js +++ b/superset-frontend/webpack.config.js @@ -290,6 +290,9 @@ const config = { // AntD version conflict has been resolved antd: path.resolve(path.join(APP_DIR, './node_modules/antd')), react: path.resolve(path.join(APP_DIR, './node_modules/react')), + // TODO: remove Handlebars alias once Handlebars NPM package has been updated to + // correctly support webpack import (https://github.com/handlebars-lang/handlebars.js/issues/953) + handlebars: 'handlebars/dist/handlebars.js', }, extensions: ['.ts', '.tsx', '.js', '.jsx', '.yml'], fallback: {