mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-10-19 11:55:49 +02:00
content: what is architecture really - first blog post in a series about software architecture
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user