content: what is architecture really - first blog post in a series about software architecture

This commit is contained in:
2025-10-14 17:02:19 +02:00
parent 29d5da925d
commit b53d579b27
5 changed files with 164 additions and 1 deletions

View File

@@ -7,7 +7,8 @@ import { compilerOptions } from "../../tsconfig.json";
const onCreateWebpackConfig = (
(options: Pick<CompilerOptions, "paths">) =>
({ actions }: CreateWebpackConfigArgs) => {
({ actions, getConfig }: CreateWebpackConfigArgs) => {
// Keep existing TS path aliases in webpack
actions.setWebpackConfig({
resolve: {
alias: Object.entries(options.paths || []).reduce(
@@ -19,6 +20,28 @@ const onCreateWebpackConfig = (
),
},
});
// Workaround: Gatsby's webpack ESLint plugin is incompatible with ESLint v9+ options
// on some environments. Remove the plugin from the webpack pipeline during development
// to prevent build failures like "Invalid Options: Unknown options: extensions, useEslintrc".
// We still keep linting via npm scripts.
try {
const config = getConfig();
if (config?.plugins?.length) {
const beforeCount = config.plugins.length;
config.plugins = config.plugins.filter((plugin: any) => {
const name = plugin?.constructor?.name;
return name !== "ESLintWebpackPlugin" && name !== "ESLintPlugin";
});
const afterCount = config.plugins.length;
// Only replace when we've actually modified the plugins array
if (afterCount !== beforeCount) {
actions.replaceWebpackConfig(config);
}
}
} catch {
// noop if Gatsby changes internals, don't crash the build
}
}
)(compilerOptions);