Skip to content

Commit

Permalink
Don't throw for configuration issues
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 8, 2023
1 parent 7f1c7f8 commit 91d8989
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WorkspaceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as npm from './manifest/index.js';
import * as plugins from './plugins/index.js';
import { debugLogArray, debugLogObject } from './util/debug.js';
import { _pureGlob, negate, hasProductionSuffix, hasNoProductionSuffix, prependDirToPattern } from './util/glob.js';
import { FAKE_PATH } from './util/loader.js';
import { get, getKeysByValue } from './util/object.js';
import { join, toPosix } from './util/path.js';
import {
Expand Down Expand Up @@ -269,7 +270,7 @@ export class WorkspaceWorker {
if (patterns.length > 0 && configFilePaths.length === 0) continue;

// Plugin has no config files configured, call it once to still get the entry:/production: patterns
if (patterns.length === 0) configFilePaths.push('__FAKE__');
if (patterns.length === 0) configFilePaths.push(FAKE_PATH);

const pluginDependencies: Set<string> = new Set();

Expand Down
4 changes: 4 additions & 0 deletions src/util/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { extname } from './path.js';
import { timerify } from './Performance.js';
import { jiti } from './register.js';

export const FAKE_PATH = '__FAKE__';

const load = async (filePath: string) => {
// TODO: Turn into a config issue warning
if (filePath === FAKE_PATH) return;
try {
const ext = extname(filePath);
if (/rc$/.test(filePath)) {
Expand Down

0 comments on commit 91d8989

Please sign in to comment.