Skip to content

Commit

Permalink
2.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yy4382 committed Oct 20, 2024
1 parent f96f7f0 commit 476ab20
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const context = await esbuild.context({
treeShaking: true,
outfile: "main.js",
inject: ["./polyfill-buffer.js"],
// minify: prod,
minify: prod,
});

if (prod) {
Expand Down
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "ob2static-site",
"name": "Static Site MD Exporter",
"version": "2.0.0-alpha.9",
"version": "2.0.0-beta.1",
"minAppVersion": "0.15.0",
"description": "Export specific notes to general md for static site generator like Hugo, Hexo, Astro and more.",
"author": "Yunfi",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ob2static-site",
"version": "2.0.0-alpha.9",
"version": "2.0.0-beta.1",
"description": "Export specific notes to general md for static site generation",
"main": "main.js",
"type": "module",
Expand Down
25 changes: 21 additions & 4 deletions polyfill-buffer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
import { Platform } from 'obsidian';
// https://github.com/Vinzent03/obsidian-git/blob/master/polyfill_buffer.js
/*
MIT License
Copyright (c) 2020 Vinzent03, Denis Olehov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/

import { Platform } from "obsidian";
let buffer;
if (Platform.isMobileApp) {
// eslint-disable-next-line @typescript-eslint/no-require-imports
buffer = require('buffer/index.js').Buffer
// eslint-disable-next-line @typescript-eslint/no-require-imports
buffer = require("buffer/index.js").Buffer;
} else {
buffer = global.Buffer
buffer = global.Buffer;
}

export const Buffer = buffer;

0 comments on commit 476ab20

Please sign in to comment.