53 const patterns = Array.isArray(from) ? from : [from];
55 return patterns.some(pat => {
57 if (pat.includes(
"**/")) {
58 const [baseDir, suffix] = pat.split(
"**/");
59 if (!
fs.existsSync(baseDir)) {
63 let found =
walk(baseDir, suffix);
68 if (/[?*]/.test(pat)) {
69 const dir =
path.dirname(pat);
70 if (!
fs.existsSync(dir)) {
74 const basename =
path.basename(pat);
75 const files =
fs.readdirSync(dir);
78 if (basename.startsWith(
"*.")) {
79 const ext = basename.slice(1);
80 const foundFile = files.some(f => f.endsWith(ext));
85 if (basename.endsWith(
"*")) {
86 const prefix = basename.slice(0, -1);
87 const foundFile = files.some(f => f.startsWith(prefix));
95 return fs.existsSync(pat);
145 name:
'esbuild-problem-matcher',
148 build.onStart(() => {
149 console.log(
'[watch] build started');
151 build.onEnd((result) => {
152 if (result.errors.length > 0) {
153 result.errors.forEach(({ text, location }) => {
154 console.error(`✘ [ERROR] ${text}`);
156 console.error(` ${location.file}:${location.line}:${location.column}`);
160 console.log(
'[watch] build finished');