mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 04:55:36 +01:00
refactor(tracker-script-name): move from middleware to next.config rewrites
This commit is contained in:
parent
c0a9ceae2f
commit
453373b356
2 changed files with 11 additions and 21 deletions
|
|
@ -44,6 +44,17 @@ if (process.env.COLLECT_API_ENDPOINT) {
|
|||
});
|
||||
}
|
||||
|
||||
if (process.env.TRACKER_SCRIPT_NAME) {
|
||||
const scriptNames = process.env.TRACKER_SCRIPT_NAME.split(',');
|
||||
|
||||
rewrites.push(
|
||||
...scriptNames.map(scriptName => ({
|
||||
source: `/${scriptName.trim()}.js`,
|
||||
destination: '/script.js',
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
const redirects = [];
|
||||
|
||||
if (process.env.CLOUD_MODE) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue