From 8ea326514be198e99584e21b6da9668045bac4d4 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 14 Dec 2022 14:35:00 -0500 Subject: [PATCH] *Update dist --- dist/index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 49b44e0..3ab3162 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27,20 +27,6 @@ const loaderFunction = `function loadNativeModuleTemp(module, data) { return loadPath; }`; function bundleNativeModulesPlugin() { - const edits = []; - /* - Copied from https://github.com/sastan/rollup-plugin-define/blob/main/src/define.ts - */ - function markEdited(node, edits) { - for (const [start, end] of edits) { - if ((start <= node.start && node.start < end) || - (start < node.end && node.end <= end)) { - return false; // Already edited - } - } - // Not edited - return edits.push([node.start, node.end]); - } return { name: "bundle-native-modules", transform(src, id, ast) { @@ -69,6 +55,20 @@ function bundleNativeModulesPlugin() { throw e; } } + const edits = []; + /* + Copied from https://github.com/sastan/rollup-plugin-define/blob/main/src/define.ts + */ + function markEdited(node, edits) { + for (const [start, end] of edits) { + if ((start <= node.start && node.start < end) || + (start < node.end && node.end <= end)) { + return false; // Already edited + } + } + // Not edited + return edits.push([node.start, node.end]); + } const findLoady = (0, ast_matcher_1.default)("require('loady')(__str_aName, __any)"); const loadyMatches = findLoady(ast); if (loadyMatches?.length) {