mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Fix tracker build.
This commit is contained in:
parent
373dbf50ba
commit
6ea6e2e27d
10
lib/web.js
10
lib/web.js
@ -61,17 +61,9 @@ export const setItem = (key, data, session) => {
|
||||
}
|
||||
};
|
||||
|
||||
function tryParse(value) {
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export const getItem = (key, session) =>
|
||||
typeof window !== 'undefined'
|
||||
? tryParse((session ? sessionStorage : localStorage).getItem(key))
|
||||
? JSON.parse((session ? sessionStorage : localStorage).getItem(key) || null)
|
||||
: null;
|
||||
|
||||
export const removeItem = (key, session) => {
|
||||
|
@ -1,6 +1,4 @@
|
||||
import 'dotenv/config';
|
||||
import buble from '@rollup/plugin-buble';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
|
||||
export default {
|
||||
@ -9,5 +7,5 @@ export default {
|
||||
file: 'public/umami.js',
|
||||
format: 'iife',
|
||||
},
|
||||
plugins: [resolve(), buble({ objectAssign: true }), terser({ compress: { evaluate: false } })],
|
||||
plugins: [buble({ objectAssign: true }), terser({ compress: { evaluate: false } })],
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user