Skip to content

Commit

Permalink
fix: Fix require of custom plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3k0 authored and 3y3 committed Apr 20, 2023
1 parent cd33753 commit d6d4af3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function getAllPlugins(): Function[] {

function getCustomPlugins(): Function[] {
try {
const customPlugins = require('./plugins');
const customPlugins = require(require.resolve('./plugins'));
return Array.isArray(customPlugins) ? customPlugins : [];
} catch (e) {
return [];
Expand All @@ -53,23 +53,23 @@ function getCustomPlugins(): Function[] {

export function getHeadContent(): string {
try {
return require('./head-content.js');
return require(require.resolve('./head-content.js'));
} catch (e) {
return '';
}
}

export function getCustomLintRules(): LintRule[] {
try {
return require('./lint-rules');
return require(require.resolve('./lint-rules'));
} catch (e) {
return [];
}
}

export function getDefaultLintConfig(): LintConfig | undefined {
try {
return require('./default-lint-config');
return require(require.resolve('./default-lint-config'));
} catch (e) {
return undefined;
}
Expand Down

0 comments on commit d6d4af3

Please sign in to comment.