one
Version:
One is a React framework for web, iOS, and Android apps.
1 lines • 1.47 kB
Source Map (JSON)
{"version":3,"file":"customNodeExternals.js","names":[],"sources":["esm/vite/customNodeExternals.js"],"sourcesContent":["import { isBuiltin } from \"node:module\";\nimport path from \"node:path\";\nfunction nodeExternals() {\n return {\n name: `node-externals`,\n enforce: \"pre\",\n resolveId: {\n order: \"pre\",\n async handler(specifier, importer, options) {\n if (options?.scan) return null;\n if (options?.isEntry || // Ignore entry points (they should always be resolved)\n /^(?:\\0|\\.{1,2}\\/)/.test(specifier) || // Ignore virtual modules and relative imports\n path.isAbsolute(specifier)) {\n return null;\n }\n if (isBuiltin(specifier)) {\n const stripped = specifier.replace(/^node:/, \"\");\n return {\n id: !isBuiltin(stripped) ? \"node:\" + stripped : stripped,\n external: true,\n moduleSideEffects: false\n };\n }\n }\n }\n };\n}\nexport {\n nodeExternals\n};\n//# sourceMappingURL=customNodeExternals.js.map\n"],"mappings":";;;;AAEA,SAAS,gBAAgB;CACvB,OAAO;EACL,MAAM;EACN,SAAS;EACT,WAAW;GACT,OAAO;GACP,MAAM,QAAQ,WAAW,UAAU,SAAS;IAC1C,IAAI,SAAS,MAAM,OAAO;IAC1B,IAAI,SAAS,WACb,oBAAoB,KAAK,SAAS,KAClC,KAAK,WAAW,SAAS,GAAG;KAC1B,OAAO;IACT;IACA,IAAI,UAAU,SAAS,GAAG;KACxB,MAAM,WAAW,UAAU,QAAQ,UAAU,EAAE;KAC/C,OAAO;MACL,IAAI,CAAC,UAAU,QAAQ,IAAI,UAAU,WAAW;MAChD,UAAU;MACV,mBAAmB;KACrB;IACF;GACF;EACF;CACF;AACF"}