@anyblock/remark-any-block 1.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/anyblock.ts +261 -0
- package/index.ts +5 -0
- package/jsdom_init.ts +30 -0
- package/package.json +36 -0
- package/styles.css +1204 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +38 -0
package/tsconfig.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"paths": {
|
|
5
|
+
"@/*": ["../../src/*"]
|
|
6
|
+
},
|
|
7
|
+
"inlineSourceMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"target": "ESNext",
|
|
11
|
+
"allowJs": true,
|
|
12
|
+
"noImplicitAny": true,
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"importHelpers": true,
|
|
15
|
+
"allowSyntheticDefaultImports": true, // 导入markdown-it/plantuml-encoder等cjs模块要加这个
|
|
16
|
+
"isolatedModules": true,
|
|
17
|
+
"jsx":"preserve",
|
|
18
|
+
"lib": [
|
|
19
|
+
"DOM",
|
|
20
|
+
"ES5",
|
|
21
|
+
"ES6",
|
|
22
|
+
"ES7",
|
|
23
|
+
"ES2021",
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
"**/*.vue",
|
|
30
|
+
"src/*.js"
|
|
31
|
+
],
|
|
32
|
+
|
|
33
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite版的编译,带混淆、带cjs和js的双编译
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { defineConfig } from 'vite'
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
build: {
|
|
9
|
+
target: "ESNext",
|
|
10
|
+
assetsInlineLimit: 0, // 禁用文件hash
|
|
11
|
+
minify: false, // 禁用代码压缩,包括混淆
|
|
12
|
+
sourcemap: true,
|
|
13
|
+
lib: {
|
|
14
|
+
entry: './index.ts',
|
|
15
|
+
|
|
16
|
+
name: 'MdItAnyBlock',
|
|
17
|
+
formats: ['es', 'cjs'], // ['es', 'cjs']
|
|
18
|
+
fileName: (format) => format == 'es'
|
|
19
|
+
? `mdit-any-block.js`
|
|
20
|
+
: `mdit-any-block.cjs`,
|
|
21
|
+
},
|
|
22
|
+
rollupOptions: {
|
|
23
|
+
// 确保您的库与其他包兼容
|
|
24
|
+
external: [
|
|
25
|
+
'markdown-it',
|
|
26
|
+
'jsdom',
|
|
27
|
+
'mermaid',
|
|
28
|
+
'@mermaid-js/mermaid-mindmap',
|
|
29
|
+
],
|
|
30
|
+
output: {
|
|
31
|
+
// Provide global variables to other scripts
|
|
32
|
+
globals: {
|
|
33
|
+
'markdown-it': 'markdownIt'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})
|