Skip to content

Commit

Permalink
feat: bundle deps
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 23, 2024
1 parent bf4cab5 commit 2cdd928
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
3 changes: 3 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ export default defineBuildConfig({
],
declaration: true,
clean: true,
rollup: {
inlineDependencies: true,
},
})
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@
"shiki": "^1.1.6",
"vue": "^3.4.0"
},
"dependencies": {
"diff-match-patch": "^1.0.5",
"ohash": "^1.1.3"
},
"devDependencies": {
"@antfu/eslint-config": "^2.6.2",
"@antfu/ni": "^0.21.12",
Expand All @@ -80,9 +76,11 @@
"@types/node": "^20.10.7",
"@unocss/reset": "^0.58.5",
"bumpp": "^9.2.1",
"diff-match-patch-es": "^0.1.0",
"eslint": "^8.56.0",
"esno": "^4.0.0",
"lint-staged": "^15.2.0",
"ohash": "^1.1.3",
"pnpm": "^8.14.0",
"rimraf": "^5.0.5",
"shiki": "^1.1.6",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

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

5 changes: 2 additions & 3 deletions src/core.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { diff_match_patch as DMP } from 'diff-match-patch'
import { diff } from 'diff-match-patch-es'
import type { HighlighterGeneric, ThemedToken, TokensResult } from 'shiki/core'
import { hash as getHash } from 'ohash'

Expand Down Expand Up @@ -185,8 +185,7 @@ export function syncTokenKeys(
* It uses `diff-match-patch` under the hood
*/
export function findTextMatches(a: string, b: string): MatchedRanges[] {
const differ = new DMP()
const delta = differ.diff_main(a, b)
const delta = diff(a, b)

let aContent = ''
let bContent = ''
Expand Down

0 comments on commit 2cdd928

Please sign in to comment.