@fast-crud/editor-markdown 1.28.3 → 1.28.5

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/tsconfig.json CHANGED
@@ -1,17 +1,49 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "allowJs": true,
3
4
  "noImplicitAny": false,
4
5
  "target": "esnext",
5
6
  "module": "esnext",
6
7
  "strict": true,
8
+ "jsx": "preserve",
9
+ "jsxImportSource": "vue",
10
+ "verbatimModuleSyntax":false ,
11
+ "importHelpers": true,
7
12
  "moduleResolution": "node",
13
+ "experimentalDecorators": true,
8
14
  "skipLibCheck": true,
9
15
  "esModuleInterop": true,
10
16
  "allowSyntheticDefaultImports": true,
17
+ "strictNullChecks" :false,
11
18
  "sourceMap": true,
12
- "types": ["vite/client"],
13
- "lib": ["esnext", "dom", "dom.iterable"]
19
+ "baseUrl": ".",
20
+ "outDir": "./dist/ts",
21
+ "types": [
22
+ "vite/client",
23
+ "mocha",
24
+ "chai",
25
+ "unplugin-vue-define-options/macros-global"
26
+ ],
27
+ "paths": {
28
+ "@/*": [
29
+ "src/*"
30
+ ]
31
+ },
32
+ "lib": [
33
+ "esnext",
34
+ "dom",
35
+ "dom.iterable",
36
+ "scripthost"
37
+ ]
14
38
  },
15
- "include": ["src/**/*.ts", "src/**/*.vue"],
16
- "exclude": ["node_modules"]
39
+ "include": [
40
+ "src/**/*.ts",
41
+ "src/**/*.tsx",
42
+ "src/**/*.vue",
43
+ "tests/**/*.ts",
44
+ "tests/**/*.tsx"
45
+ ],
46
+ "exclude": [
47
+ "node_modules"
48
+ ]
17
49
  }
package/vite.config.js CHANGED
@@ -1,26 +1,107 @@
1
1
  import vue from "@vitejs/plugin-vue";
2
+ import vueJsx from "@vitejs/plugin-vue-jsx";
2
3
  import path from "path";
3
-
4
+ import { visualizer } from "rollup-plugin-visualizer";
5
+ import strip from "@rollup/plugin-strip";
6
+ import DefineOptions from "unplugin-vue-define-options/vite";
7
+ import typescript from "@rollup/plugin-typescript";
8
+ import _ from "lodash";
4
9
  const { resolve } = path;
10
+ // https://vitejs.dev/config/
11
+ export default ({ command, mode }) => {
12
+ let build = {};
13
+ if (mode === "umd") {
14
+ build = {
15
+ build: {
16
+ emptyOutDir: true,
17
+ lib: {
18
+ entry: resolve(__dirname, "src/index.umd.ts"),
19
+ formats: ["umd"]
20
+ },
21
+ rollupOptions: {
22
+ output: {
23
+ manualChunks: null
24
+ }
25
+ }
26
+ }
27
+ };
28
+ }
5
29
 
6
- export default ({ mode }) => ({
7
- plugins: [vue()],
8
- build: {
9
- emptyOutDir: mode === "umd",
10
- lib: {
11
- entry: resolve(__dirname, mode === "umd" ? "src/index.umd.ts" : "src/index.ts"),
12
- name: "FsEditorMarkdown",
13
- formats: [mode === "umd" ? "umd" : "es"]
30
+ const options = {
31
+ base: "./",
32
+ plugins: [DefineOptions(), vueJsx(), vue()],
33
+ esbuild: {
34
+ drop: command === "build" ? ["debugger"] : [],
35
+ jsxFactory: "h",
36
+ jsxFragment: "Fragment",
37
+ pure: ["console.log", "debugger"]
14
38
  },
15
- rollupOptions: {
16
- external: ["vue", "@fast-crud/fast-crud", "mavon-editor"],
17
- output: {
18
- globals: {
19
- vue: "Vue",
20
- "@fast-crud/fast-crud": "FastCrud",
21
- "mavon-editor": "MavonEditor"
39
+ build: {
40
+ emptyOutDir: false,
41
+ lib: {
42
+ entry: resolve(__dirname, "src/index.ts"),
43
+ name: "FsExtends",
44
+ formats: ["es"]
45
+ },
46
+ // cssCodeSplit: true,
47
+ sourcemap: true,
48
+ // minify: false,
49
+ rollupOptions: {
50
+ plugins: [
51
+ strip(),
52
+ visualizer(),
53
+ typescript({
54
+ target: "es2020",
55
+ rootDir: "src",
56
+ declaration: true,
57
+ declarationDir: "dist/d",
58
+ exclude: "./node_modules/**",
59
+ allowSyntheticDefaultImports: true
60
+ })
61
+ ],
62
+ // make sure to externalize deps that shouldn't be bundled
63
+ // into your library
64
+ external: [
65
+ "vue",
66
+ "lodash-es",
67
+ "dayjs",
68
+ "vue-i18n",
69
+ "vuedraggable",
70
+ "axios",
71
+ "qiniu-js",
72
+ "@fast-crud/fast-crud",
73
+ "@fast-crud/ui-interface",
74
+ "mavon-editor"
75
+ ],
76
+ output: {
77
+ manualChunks(id) {
78
+ if (id.includes("src/components") && id.lastIndexOf(".vue") > 0) {
79
+ let name = id.substring(id.lastIndexOf("/") + 1);
80
+ name = name.substring(0, name.indexOf("."));
81
+ return "components/" + name;
82
+ }
83
+ },
84
+ // Provide global variables to use in the UMD build
85
+ // for externalized deps
86
+ globals: {
87
+ vue: "Vue",
88
+ "lodash-es": "_",
89
+ dayjs: "dayjs",
90
+ "vue-i18n": "VueI18n",
91
+ axios: "axios",
92
+ vuedraggable: "vuedraggable",
93
+ "@fast-crud/fast-crud": "FastCrud",
94
+ "ali-oss": "OSS",
95
+ "cos-js-sdk-v5": "COS",
96
+ "qiniu-js": "qiniu",
97
+ "@fast-crud/ui-interface": "FsUiInterface",
98
+ "mavon-editor": "MavonEditor"
99
+ }
22
100
  }
23
101
  }
24
102
  }
25
- }
26
- });
103
+ };
104
+
105
+ _.merge(options, build);
106
+ return options;
107
+ };
@@ -1,7 +0,0 @@
1
- import { FsEditorMarkdownComponent as r } from "./editor-markdown.mjs";
2
- import "@fast-crud/fast-crud";
3
- import "vue";
4
- import "mavon-editor";
5
- export {
6
- r as default
7
- };