From e7a0ded14a2a994889cf1808f0a54436334773dc Mon Sep 17 00:00:00 2001 From: xw Date: Fri, 3 Dec 2021 15:50:23 +0800 Subject: [PATCH] fix: Upgrade node-fetch (#115) --- md-cli/package.json | 4 ++-- md-cli/util.js | 2 +- mm/util.js | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/md-cli/package.json b/md-cli/package.json index e620c09..02bec5d 100644 --- a/md-cli/package.json +++ b/md-cli/package.json @@ -1,6 +1,6 @@ { "name": "@doocs/md-cli", - "version": "0.0.2", + "version": "0.0.3", "description": "✍ 一款高度简洁的微信 Markdown 编辑器:支持 Markdown 所有基础语法、色盘取色、一键复制并粘贴到公众号后台、多图上传、一键下载文档、自定义 CSS 样式、一键重置等特性", "main": "index.js", "scripts": { @@ -23,6 +23,6 @@ "form-data": "2.3.3", "get-port": "5.1.1", "mockm": "^1.1.25", - "node-fetch": "2.6.2" + "node-fetch": "^3.1.0" } } diff --git a/md-cli/util.js b/md-cli/util.js index e411f15..f04cc21 100644 --- a/md-cli/util.js +++ b/md-cli/util.js @@ -1,4 +1,4 @@ -const fetch = require('node-fetch') +const fetch = (...args) => import(`node-fetch`).then(({default: fetch}) => fetch(...args)) const FormData = require(`form-data`) /** diff --git a/mm/util.js b/mm/util.js index a069b1d..476211b 100644 --- a/mm/util.js +++ b/mm/util.js @@ -1,4 +1,4 @@ -const fetch = require('node-fetch') +const fetch = (...args) => import(`node-fetch`).then(({default: fetch}) => fetch(...args)) const FormData = require(`form-data`) function dcloud(spaceInfo) { diff --git a/package.json b/package.json index 53f336e..8803f68 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "jquery": "^3.6.0", "juice": "^8.0.0", "marked": "^4.0.5", - "node-fetch": "3.1.0", + "node-fetch": "^3.1.0", "prettier": "^2.5.0", "prettify": "^0.1.7", "qiniu-js": "^3.4.0",