diff --git a/next.config.js b/next.config.js index 33a43ee7bb..808d369146 100644 --- a/next.config.js +++ b/next.config.js @@ -3,7 +3,7 @@ require('dotenv').config(); const path = require('path'); const pkg = require('./package.json'); -const TRACKER_SCRIPT = '/script.js'; +const TRACKER_SCRIPT = '/tracker.js'; const basePath = process.env.BASE_PATH; const collectApiEndpoint = process.env.COLLECT_API_ENDPOINT; @@ -68,12 +68,10 @@ const headers = [ const rewrites = []; -if (trackerScriptURL) { - rewrites.push({ - source: TRACKER_SCRIPT, - destination: trackerScriptURL, - }); -} +rewrites.push({ + source: '/script.js', + destination: trackerScriptURL || TRACKER_SCRIPT, +}); if (collectApiEndpoint) { rewrites.push({ diff --git a/rollup.tracker.config.mjs b/rollup.tracker.config.mjs index 05df28798d..4b1f0e0e25 100644 --- a/rollup.tracker.config.mjs +++ b/rollup.tracker.config.mjs @@ -5,7 +5,7 @@ import { terser } from 'rollup-plugin-terser'; export default { input: 'src/tracker/index.js', output: { - file: 'public/script.js', + file: 'public/tracker.js', format: 'iife', }, plugins: [