Skip to content

Commit fd7ed7c

Browse files
authored
feat: support scriptletGlobals (#26)
* feat: support `scriptletGlobals` * chore: put build results
1 parent ddab0c8 commit fd7ed7c

File tree

2 files changed

+83
-166
lines changed

2 files changed

+83
-166
lines changed

build.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ scriptlets['${scriptlet.name}'] = {
6464
aliases: ${JSON.stringify(scriptlet.aliases || [])},
6565
${scriptlet.world ? `world: '${scriptlet.world}',` : '' }
6666
requiresTrust: ${scriptlet.requiresTrust || false},
67-
func: function (...args) {
68-
const scriptletGlobals = {};
67+
func: function (scriptletGlobals = {}, ...args) {
6968
${deps.map((dep) => dep.toString()).join('\n')}
7069
${scriptlet.fn.toString()};
7170
${scriptlet.fn.name}(...args);

0 commit comments

Comments
 (0)