From 3a58526c4c9126d48acf62b2cf067b93e13ee2da Mon Sep 17 00:00:00 2001 From: Glenn Engel Date: Sun, 4 Dec 2022 17:29:22 -0800 Subject: [PATCH] Allow modules with template literals --- package.json | 1 + webpack.config.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/package.json b/package.json index 82196fd..525a019 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.18.0", "@babel/plugin-proposal-optional-chaining": "^7.17.12", "@babel/plugin-transform-object-assign": "^7.16.7", + "@babel/plugin-transform-template-literals": "^7.18.9", "@babel/polyfill": "^7.12.1", "@babel/preset-env": "^7.18.2", "@babel/preset-react": "^7.17.12", diff --git a/webpack.config.js b/webpack.config.js index b0835c7..41caf2d 100755 --- a/webpack.config.js +++ b/webpack.config.js @@ -135,6 +135,21 @@ const clientConfig = ({ isDevClientWrapper }) => ({ resolve: { fullySpecified: false, }, + use: [ + { + // Fix #157 Issue with template literals in firebase module + loader: 'babel-loader', + options: { + compact: false, + plugins: [ + '@babel/plugin-transform-template-literals', + !isProd && + !isDevClientWrapper && + require.resolve('react-refresh/babel'), + ].filter(Boolean), + }, + }, + ], }, // typescript config {