@plugjs/plug
Version:
PlugJS Build System ===================
49 lines (47 loc) • 1.66 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// plugs/esbuild/bundle-locals.ts
var bundle_locals_exports = {};
__export(bundle_locals_exports, {
bundleLocals: () => bundleLocals
});
module.exports = __toCommonJS(bundle_locals_exports);
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 };
});
}
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
bundleLocals
});
//# sourceMappingURL=bundle-locals.cjs.map