esbuild-multicontext
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -37,4 +37,4 @@ var __create = Object.create; | ||
var import_node_fs = require("fs"); | ||
var import_node_path = __toESM(require("path"), 1); | ||
var import_tiny_glob = __toESM(require("tiny-glob"), 1); | ||
var import_node_path = __toESM(require("path"), 1); | ||
var createContextWatcher = (context) => { | ||
@@ -59,2 +59,3 @@ const watchers = []; | ||
}; | ||
const builder = () => context.build.bind(context); | ||
return (globPattern, { root, onEvent, onBuild } = { root: "." }) => { | ||
@@ -65,3 +66,3 @@ syncify(globPattern, root, () => { | ||
if (!onEvent) { | ||
return forcePromise(context.build).then(() => { | ||
return forcePromise(builder).then(() => { | ||
onBuild == null ? void 0 : onBuild(); | ||
@@ -76,3 +77,3 @@ }); | ||
return; | ||
return forcePromise(context.build).then(() => { | ||
return forcePromise(builder).then(() => { | ||
onBuild == null ? void 0 : onBuild(); | ||
@@ -79,0 +80,0 @@ }); |
{ | ||
"name": "esbuild-multicontext", | ||
"description": "Minimal wrapper over esbuild's context API", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "type": "module", |
import chokidar from 'chokidar' | ||
import type { ContextManager } from './lib/ContextManager.js' | ||
import { existsSync } from 'node:fs' | ||
import path from 'node:path' | ||
import glob from 'tiny-glob' | ||
import path from 'node:path' | ||
@@ -41,2 +40,5 @@ export type WatchEvent = { | ||
} | ||
const builder = () => context.build.bind(context) | ||
return (globPattern, { root, onEvent, onBuild }: Options = { root: '.' }) => { | ||
@@ -47,3 +49,3 @@ syncify(globPattern, root, () => { | ||
if (!onEvent) { | ||
return forcePromise(context.build).then(() => { | ||
return forcePromise(builder).then(() => { | ||
onBuild?.() | ||
@@ -58,3 +60,3 @@ }) | ||
if (!build) return | ||
return forcePromise(context.build).then(() => { | ||
return forcePromise(builder).then(() => { | ||
onBuild?.() | ||
@@ -61,0 +63,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44413
965