From d5b4bdeb72e558e78d80e0fdb47249467cb14f03 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) --- 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 11bed49ee..095c5836c 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 f2919b0d2..9f9e03974 100644 --- a/superset-frontend/webpack.config.js +++ b/superset-frontend/webpack.config.js @@ -289,6 +289,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: {