Skip to content

Commit

Permalink
Work around CJS issue for CRA / DuckDB
Browse files Browse the repository at this point in the history
  • Loading branch information
alukach committed Nov 25, 2024
1 parent a740e6c commit b662e52
Show file tree
Hide file tree
Showing 4 changed files with 491 additions and 4 deletions.
23 changes: 23 additions & 0 deletions craco.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// https://github.com/facebook/create-react-app/issues/12700#issuecomment-1463040093
// eslint-disable-next-line import/no-anonymous-default-export
export default {
webpack: {
configure: (config: any) => ({
...config,
module: {
...config.module,
rules: config.module.rules.map((rule: any) => {
if (rule.oneOf instanceof Array) {
// eslint-disable-next-line no-param-reassign
rule.oneOf[rule.oneOf.length - 1].exclude = [
/\.(js|mjs|jsx|cjs|ts|tsx)$/,
/\.html$/,
/\.json$/,
];
}
return rule;
}),
},
}),
},
};
Loading

0 comments on commit b662e52

Please sign in to comment.