Skip to content

Commit

Permalink
perf: minify prod output
Browse files Browse the repository at this point in the history
  • Loading branch information
murtuzaalisurti committed Jun 14, 2024
1 parent e55a9ff commit 82e096f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 375 deletions.
3 changes: 2 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const config = {
entryPoints: ['main.js'],
bundle: true,
target: ['es2020'],
outdir: './public'
outdir: './public',
minify: true
};

mode === "watch"
Expand Down
11 changes: 2 additions & 9 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
/**
* @license
* This component uses a custom loash build which includes only the 'throttle' module
*/
// This component uses a custom loash build which includes only the 'throttle' module
import throttle from "./modularize/throttle.js"

class BackToTop extends HTMLElement {
constructor() {
super();
this.currentScrollPos = 0;
this.throttleRate = 400; // milliseconds
this.buttonContent = `
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>
</template>
`
this.buttonContent = `<template><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg></template>`
}

static get observedAttributes() {
Expand Down
Loading

0 comments on commit 82e096f

Please # to comment.