mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Removed encoding.
This commit is contained in:
parent
87737e35bc
commit
fbea08ae59
2 changed files with 18 additions and 42 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
const path = require('path');
|
|
||||||
const pkg = require('./package.json');
|
const pkg = require('./package.json');
|
||||||
|
|
||||||
const TRACKER_SCRIPT = '/script.js';
|
const TRACKER_SCRIPT = '/script.js';
|
||||||
|
|
@ -169,27 +168,22 @@ const config = {
|
||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
|
experimental: {
|
||||||
|
turbo: {
|
||||||
|
rules: {
|
||||||
|
'*.svg': {
|
||||||
|
loaders: ['@svgr/webpack'],
|
||||||
|
as: '*.js',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
webpack(config) {
|
webpack(config) {
|
||||||
const fileLoaderRule = config.module.rules.find(rule => rule.test?.test?.('.svg'));
|
config.module.rules.push({
|
||||||
|
test: /\.svg$/,
|
||||||
config.module.rules.push(
|
issuer: /\.(js|ts)x?$/,
|
||||||
{
|
use: ['@svgr/webpack'],
|
||||||
...fileLoaderRule,
|
});
|
||||||
test: /\.svg$/i,
|
|
||||||
resourceQuery: /url/,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.svg$/i,
|
|
||||||
issuer: fileLoaderRule.issuer,
|
|
||||||
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
|
|
||||||
use: ['@svgr/webpack'],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
fileLoaderRule.exclude = /\.svg$/i;
|
|
||||||
|
|
||||||
config.resolve.alias['public'] = path.resolve('./public');
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
async headers() {
|
async headers() {
|
||||||
|
|
|
||||||
|
|
@ -34,24 +34,6 @@
|
||||||
|
|
||||||
/* Helper functions */
|
/* Helper functions */
|
||||||
|
|
||||||
const encode = str => {
|
|
||||||
if (!str) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const result = decodeURI(str);
|
|
||||||
|
|
||||||
if (result !== str) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
return encodeURI(str);
|
|
||||||
};
|
|
||||||
|
|
||||||
const parseURL = url => {
|
const parseURL = url => {
|
||||||
try {
|
try {
|
||||||
const { pathname, search, hash } = new URL(url, location.href);
|
const { pathname, search, hash } = new URL(url, location.href);
|
||||||
|
|
@ -67,9 +49,9 @@
|
||||||
hostname,
|
hostname,
|
||||||
screen,
|
screen,
|
||||||
language,
|
language,
|
||||||
title: encode(title),
|
title,
|
||||||
url: encode(currentUrl),
|
url: currentUrl,
|
||||||
referrer: encode(currentRef),
|
referrer: currentRef,
|
||||||
tag: tag ? tag : undefined,
|
tag: tag ? tag : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue