Fix tracker build.

This commit is contained in:
Mike Cao 2022-03-02 12:10:47 -08:00
parent 373dbf50ba
commit 6ea6e2e27d
2 changed files with 2 additions and 12 deletions

View File

@ -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) => {

View File

@ -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 } })],
};