*Update dist

This commit is contained in:
Derrick Hammer 2022-12-31 22:45:26 -05:00
parent d220d9831e
commit 366ffe1ac9
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 31 additions and 24 deletions

11
dist/index.js vendored
View File

@ -69,7 +69,8 @@ function bundleNativeModulesPlugin() {
// Not edited
return edits.push([node.start, node.end]);
}
const findLoady = (0, ast_matcher_1.default)("require('loady')(__str_aName, __any)");
for (const matchString of ["require('loady')(__str_aName, __any)"]) {
const findLoady = (0, ast_matcher_1.default)(matchString);
const loadyMatches = findLoady(ast);
if (loadyMatches?.length) {
for (const match of loadyMatches) {
@ -81,7 +82,12 @@ function bundleNativeModulesPlugin() {
}
}
}
const findNodeBuildGyp = (0, ast_matcher_1.default)("require('node-gyp-build')(__any)");
}
for (const matchString of [
"require('node-gyp-build')(__any)",
"loadNAPI(__any)",
]) {
const findNodeBuildGyp = (0, ast_matcher_1.default)(matchString);
const nodeBuildGypMatches = findNodeBuildGyp(ast);
if (nodeBuildGypMatches?.length) {
for (const match of nodeBuildGypMatches) {
@ -99,6 +105,7 @@ function bundleNativeModulesPlugin() {
}
}
}
}
if (edits.length === 0) {
return null;
}