@plugjs/plug
Version:
PlugJS Build System ===================
24 lines (23 loc) • 617 B
JavaScript
// plugs/esbuild/bundle-locals.ts
function bundleLocals() {
let disabled = false;
return {
name: "bundle-locals",
setup(build) {
build.onStart(() => {
if (build.initialOptions.bundle) return;
disabled = true;
return { warnings: [{ text: "Plugin disabled when not bundling" }] };
});
build.onResolve({ filter: /.*/ }, (args) => {
if (disabled) return;
if (!args.importer) return null;
return args.path.startsWith(".") ? null : { external: true };
});
}
};
}
export {
bundleLocals
};
//# sourceMappingURL=bundle-locals.mjs.map