Browse Source

:sparkles: fix #86

Van 6 years ago
parent
commit
d1a3b6b391
4 changed files with 27 additions and 10 deletions
  1. 3 2
      CHANGELOG.md
  2. 2 5
      package.json
  3. 18 0
      src/method.ts
  4. 4 3
      webpack.config.js

+ 3 - 2
CHANGELOG.md

@@ -7,9 +7,9 @@
 
 ### TODO
 
-* [86](https://github.com/b3log/vditor/issues/86) 代码分包优化 `feature`
+* WYSIWYG
 
-### v1.7.11 / 2019-08-22
+### v1.7.14 / 2019-08-22
 
 * [103](https://github.com/b3log/vditor/issues/103) 光标位置应在正中间 `feature`
 * [102](https://github.com/b3log/vditor/issues/102) 安装依赖后自动删除已有的依赖 `question`
@@ -28,6 +28,7 @@
 * [89](https://github.com/b3log/vditor/issues/89) 自定义 toolbar 事件、添加按钮到 toolbar 上 `feature`
 * [88](https://github.com/b3log/vditor/issues/88) resize 优化 `enhancement`
 * [87](https://github.com/b3log/vditor/issues/87) 获取文本时对 HTML 实体进行转换 `bug`
+* [86](https://github.com/b3log/vditor/issues/86) 代码分包优化 `feature`
 * [85](https://github.com/b3log/vditor/issues/85) 改善提示且提供提示接口 `feature`
 * [84](https://github.com/b3log/vditor/issues/84) 支持全屏预览 `feature`
 

+ 2 - 5
package.json

@@ -1,6 +1,6 @@
 {
-  "name": "@b3log/vditor",
-  "version": "1.7.13",
+  "name": "vditor",
+  "version": "1.7.14",
   "cdn": "https://cdn.jsdelivr.net/npm",
   "description": "A markdown editor written in TypeScript",
   "author": " Vanessa <[email protected]> (http://vanessa.b3log.org)",
@@ -57,9 +57,6 @@
     "webpack-dev-server": "^3.7.2"
   },
   "license": "MIT",
-  "publishConfig": {
-    "registry": "https://npm.pkg.github.com"
-  },
   "repository": "git://github.com/b3log/vditor.git",
   "bugs": {
     "url": "https://github.com/b3log/vditor/issues"

+ 18 - 0
src/method.ts

@@ -0,0 +1,18 @@
+import {abcRender} from "./ts/markdown/abcRender";
+import {chartRender} from "./ts/markdown/chartRender";
+import {codeRender} from "./ts/markdown/codeRender";
+import {mathRender} from "./ts/markdown/mathRender";
+import {mermaidRender} from "./ts/markdown/mermaidRender";
+import {markdownItRender} from "./ts/markdown/render";
+
+class Vditor {
+
+    public static mathRender = mathRender;
+    public static mermaidRender = mermaidRender;
+    public static abcRender = abcRender;
+    public static codeRender = codeRender;
+    public static chartRender = chartRender;
+    public static md2html = markdownItRender;
+}
+
+export default Vditor;

+ 4 - 3
webpack.config.js

@@ -2,7 +2,7 @@
  * @fileoverview webpack.
  *
  * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
- * @version 0.1.0.1, Jul 14, 2019
+ * @version 0.2.0.0, Aug 22, 2019
  */
 
 const path = require('path')
@@ -118,6 +118,7 @@ module.exports = [
     },
     entry: {
       'index.min': './src/index.ts',
+      'method.min': './src/method.ts'
     },
     resolve: {
       extensions: ['.js', '.ts', '.svg', 'png'],
@@ -176,7 +177,7 @@ module.exports = [
       ],
     },
     plugins: [
-      // new BundleAnalyzerPlugin(),
+      new BundleAnalyzerPlugin(),
       new webpack.DefinePlugin({
         VDITOR_VERSION: JSON.stringify(pkg.version),
         CDN_PATH: JSON.stringify(pkg.cdn),
@@ -195,4 +196,4 @@ module.exports = [
         },
       },
     },
-  }]
+  }]