Skip to content

Commit

Permalink
fix: Use rollup to build as UDM(es5)
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Oct 16, 2024
1 parent 0709051 commit 11f8096
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 31 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"version": "0.0.0",
"description": "",
"scripts": {
"build": "node build-plugin.js"
"build:umd": "cd src/atsphinx/revealjs_rtd/static/atsphinx-revealjs-rtd && rollup --compact -n RevealRTD -f umd -o rtd.js plugin.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"esbuild": "^0.24.0",
"esbuild-plugin-umd-wrapper": "^3.0.0"
"rollup": "^4.24.0"
}
}
171 changes: 171 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const Plugin = {
init(reveal) {
const deck = reveal;
deck.addKeyBinding({keyCode: 68, key: 'D', description: 'Toggle RTD widget'}, function() {
console.debug("Press toggle-key of RTD.");
const flyout = document.querySelector("readthedocs-flyout");
if (!flyout) return;
flyout.style.display = flyout.style.display ? "" : "none";
Expand Down
33 changes: 5 additions & 28 deletions src/atsphinx/revealjs_rtd/static/atsphinx-revealjs-rtd/rtd.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f()}else if("function"==typeof define && define.amd){define("RevealRTD",f)}else {g["RevealRTD"]=f()}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : this,function(){var exports={};var __exports=exports;var module={exports};
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var plugin_exports = {};
__export(plugin_exports, {
default: () => plugin_default
});
module.exports = __toCommonJS(plugin_exports);
const Plugin = {
id: "rtd",
(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?module.exports=f():typeof define==='function'&&define.amd?define(f):(g=typeof globalThis!=='undefined'?globalThis:g||self,g.RevealRTD=f());})(this,(function(){'use strict';const Plugin = {
id: 'rtd',
init(reveal) {
const deck = reveal;
deck.addKeyBinding({ keyCode: 68, key: "D", description: "Toggle RTD widget" }, function() {
deck.addKeyBinding({keyCode: 68, key: 'D', description: 'Toggle RTD widget'}, function() {
console.debug("Press toggle-key of RTD.");
const flyout = document.querySelector("readthedocs-flyout");
if (!flyout) return;
flyout.style.display = flyout.style.display ? "" : "none";
});
}
};
var plugin_default = () => Plugin;

if(__exports != exports)module.exports = exports;return module.exports}));
var plugin = () => Plugin;return plugin;}));

0 comments on commit 11f8096

Please sign in to comment.