Skip to content

Commit

Permalink
terser minify
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Dec 30, 2024
1 parent 78e7880 commit d3f316a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 49 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"dist"
],
"devDependencies": {
"terser": "^5.37.0",
"tsup": "^8.2.4",
"typescript": "^5.4.5"
},
Expand Down
1 change: 1 addition & 0 deletions packages/core/browser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// This file serves as an entry point for the package
import { Lenis } from './src/lenis'
globalThis.Lenis = Lenis
globalThis.Lenis.prototype = Lenis.prototype
93 changes: 45 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ function makeBuildOptions(

const minifyOptions = {
...options,
minify: true,
minify: 'terser',
terserOptions: {
mangle: {
reserved: ['Lenis'],
},
},
outExtension: () => ({ js: '.min.js' }),
...overwrites,
} satisfies Options
Expand Down

0 comments on commit d3f316a

Please sign in to comment.