Compare commits
2 Commits
1f5eb3657e
...
366ffe1ac9
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 366ffe1ac9 | |
Derrick Hammer | d220d9831e |
|
@ -69,7 +69,8 @@ function bundleNativeModulesPlugin() {
|
||||||
// Not edited
|
// Not edited
|
||||||
return edits.push([node.start, node.end]);
|
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);
|
const loadyMatches = findLoady(ast);
|
||||||
if (loadyMatches?.length) {
|
if (loadyMatches?.length) {
|
||||||
for (const match of loadyMatches) {
|
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);
|
const nodeBuildGypMatches = findNodeBuildGyp(ast);
|
||||||
if (nodeBuildGypMatches?.length) {
|
if (nodeBuildGypMatches?.length) {
|
||||||
for (const match of nodeBuildGypMatches) {
|
for (const match of nodeBuildGypMatches) {
|
||||||
|
@ -99,6 +105,7 @@ function bundleNativeModulesPlugin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (edits.length === 0) {
|
if (edits.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
12
src/index.ts
12
src/index.ts
|
@ -80,7 +80,8 @@ export default function bundleNativeModulesPlugin() {
|
||||||
return edits.push([node.start, node.end]);
|
return edits.push([node.start, node.end]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const findLoady = astMatcher("require('loady')(__str_aName, __any)");
|
for (const matchString of ["require('loady')(__str_aName, __any)"]) {
|
||||||
|
const findLoady = astMatcher(matchString);
|
||||||
const loadyMatches = findLoady(ast);
|
const loadyMatches = findLoady(ast);
|
||||||
|
|
||||||
if (loadyMatches?.length) {
|
if (loadyMatches?.length) {
|
||||||
|
@ -97,8 +98,13 @@ export default function bundleNativeModulesPlugin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const findNodeBuildGyp = astMatcher("require('node-gyp-build')(__any)");
|
for (const matchString of [
|
||||||
|
"require('node-gyp-build')(__any)",
|
||||||
|
"loadNAPI(__any)",
|
||||||
|
]) {
|
||||||
|
const findNodeBuildGyp = astMatcher(matchString);
|
||||||
const nodeBuildGypMatches = findNodeBuildGyp(ast);
|
const nodeBuildGypMatches = findNodeBuildGyp(ast);
|
||||||
|
|
||||||
if (nodeBuildGypMatches?.length) {
|
if (nodeBuildGypMatches?.length) {
|
||||||
|
@ -121,7 +127,7 @@ export default function bundleNativeModulesPlugin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (edits.length === 0) {
|
if (edits.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue