diff --git a/next.config.js b/next.config.js index b610eb2c83..cc295c8997 100644 --- a/next.config.js +++ b/next.config.js @@ -61,7 +61,7 @@ if (trackerScriptName) { names.forEach(name => { rewrites.push({ source: `/${name.replace(/^\/+/, '')}`, - destination: '/script.js', + destination: '/tracker.js', }); }); } @@ -163,6 +163,10 @@ const config = { async rewrites() { return [ ...rewrites, + { + source: '/script.js', + destination: 'https://tracker-script.umami.dev/', + }, { source: '/telemetry.js', destination: '/api/scripts/telemetry', 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: [