Skip to content

Commit a711404

Browse files
committed
feat: parse to get all html entities with position and ast maintained
Signed-off-by: Neko Ayaka <[email protected]>
1 parent 55dca6c commit a711404

File tree

4 files changed

+10
-185
lines changed

4 files changed

+10
-185
lines changed

build.config.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { exec } from 'node:child_process'
22
import { promisify } from 'node:util'
3+
import { env } from 'node:process'
4+
35
import { defineBuildConfig } from 'unbuild'
46
import builtins from 'builtin-modules'
57

@@ -37,7 +39,7 @@ export default defineBuildConfig({
3739
output: {
3840
dir: './dist',
3941
format: 'cjs',
40-
sourcemap: true,
42+
sourcemap: env.NODE_ENV === 'development' ? 'inline' : false,
4143
entryFileNames: 'main.js',
4244
},
4345
// required for unocss, ofetch, etc.
@@ -47,13 +49,9 @@ export default defineBuildConfig({
4749
inlineDependencies: true,
4850
},
4951
hooks: {
50-
'build:before': async () => {
51-
await execAsync('rm -rf ./main.js')
52-
await execAsync('rm -rf ./main.js.map')
53-
},
5452
'build:done': async () => {
53+
await execAsync('rm -rf ./main.js')
5554
await execAsync('cp ./dist/main.js ./main.js')
56-
await execAsync('cp ./dist/main.js.map ./main.js.map')
5755
},
5856
},
5957
})

package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"dist"
2323
],
2424
"scripts": {
25+
"build:dev": "NODE_ENV=development unbuild",
2526
"build": "unbuild",
2627
"lint": "eslint --cache ."
2728
},
@@ -31,10 +32,7 @@
3132
"@types/node": "^20.14.10",
3233
"builtin-modules": "^3.3.0",
3334
"eslint": "^8.57.0",
34-
"hast-util-to-html": "^9.0.1",
3535
"obsidian": "^1.5.7",
36-
"rehype-format": "^5.0.0",
37-
"rehype-minify-whitespace": "^6.0.0",
3836
"rehype-raw": "^7.0.0",
3937
"rehype-stringify": "^10.0.0",
4038
"remark-parse": "^11.0.0",
@@ -44,8 +42,5 @@
4442
"unified": "^11.0.5",
4543
"unist-util-remove": "^4.0.0",
4644
"vue": "^3.4.31"
47-
},
48-
"dependencies": {
49-
"remark-retext": "^6.0.0"
5045
}
5146
}

0 commit comments

Comments
 (0)