From 471b9f011d7c444075458dfcca8e469a0bbd8dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Varga?= Date: Thu, 28 Nov 2024 20:33:59 +0100 Subject: [PATCH] fix: Use ES export for analytics.js (#49) Replaced CommonJS module export with ES export in `analytics.js` to ensure compatibility with the project setup. --- src/js/analytics.js | 5 +---- webpack.config.js | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/js/analytics.js b/src/js/analytics.js index 5ad8d1d..c36bb45 100644 --- a/src/js/analytics.js +++ b/src/js/analytics.js @@ -16,7 +16,4 @@ const firebaseConfig = { const app = initializeApp(firebaseConfig); // Initialize Analytics and get a reference to the service -const analytics = getAnalytics(app); - -// Export analytics -module.exports = analytics; +export const analytics = getAnalytics(app); diff --git a/webpack.config.js b/webpack.config.js index 2abc8da..0246f1b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,13 +20,14 @@ const context = path.join(__dirname, 'src'); const outputDir = path.join(__dirname, 'dist'); module.exports = { - mode: "production", + mode: "production", entry: { index: './src/js/index.js', pageNotFound: './src/js/404.js', }, output: { path: outputDir, + publicPath: '', filename: '[name].[contenthash:8].js', sourceMapFilename: '[name].[contenthash:8].js.map', chunkFilename: '[id].[contenthash:8].js',