Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚑️ fix(core): Minify whitespaces when compiling setup files #1105

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/utils/getWalletSetupFuncHash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function getWalletSetupFuncHash(walletSetupFunc: AnyFunction) {
// Different execution engines -> different codes -> different hashes.
const { code } = esbuild.transformSync(walletSetupFunc.toString(), {
format: 'esm',
minifyWhitespace: true,
drop: ['console', 'debugger'],
loader: 'ts',
logLevel: 'silent'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/defineWalletSetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
import { defineWalletSetup } from '../src/defineWalletSetup'

const PASSWORD = 'Quack Quack! 🦆'
const EXPECTED_HASH = '69620d59802a61c6900f'
const EXPECTED_HASH = 'f9c5ea5bb2c3aac96ff4'

const testWalletSetupFunction = async (): Promise<void> => {
const result = 1 + 2
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/utils/getWalletSetupFuncHash.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest'
import { WALLET_SETUP_FUNC_HASH_LENGTH, getWalletSetupFuncHash } from '../../src/utils/getWalletSetupFuncHash'

const EXPECTED_HASH = 'c339a616cd86dc167b68'
const EXPECTED_HASH = 'b940c886be3c1a041ddd'

const testFunction = async (name: string) => {
return `Hello ${name}!`
Expand Down
Loading