Skip to content

date-fns increased vsix size by 2MB #773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JohnstonCode opened this issue Jan 8, 2020 · 6 comments · Fixed by #810
Closed

date-fns increased vsix size by 2MB #773

JohnstonCode opened this issue Jan 8, 2020 · 6 comments · Fixed by #810

Comments

@JohnstonCode
Copy link
Owner

No description provided.

@JohnstonCode JohnstonCode changed the title date-fns increated vsix size by 2MB date-fns increased vsix size by 2MB Jan 9, 2020
@JohnstonCode
Copy link
Owner Author

vsix is 1.1MB using moment js

@edgardmessias
Copy link
Contributor

Try with day.js

@JohnstonCode
Copy link
Owner Author

JohnstonCode commented Jan 9, 2020

day.js does not have the formatDistanceToNow functionality

@Yanpas
Copy link
Contributor

Yanpas commented Jan 12, 2020

RelativeTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) for some reason is unavailable, despite vscode uses node 12.4
Seems it will be soon available in typescript microsoft/TypeScript#36084

Tried rewrite import statement (according to date-fns/date-fns#771), but that didn't help:

diff --git a/src/historyView/common.ts b/src/historyView/common.ts
index 3c862023..3e07ad15 100644
--- a/src/historyView/common.ts
+++ b/src/historyView/common.ts
@@ -1,5 +1,5 @@
 import { createHash } from "crypto";
-import { formatDistanceToNow } from "date-fns";
+import formatDistanceToNow from "date-fns/formatDistanceToNow";
 import * as path from "path";
 import {

@JohnstonCode
Copy link
Owner Author

Yeah i tried different variations of imports and it did not seem to make a difference.

@JohnstonCode
Copy link
Owner Author

🎉 This issue has been resolved in version 2.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants