Skip to content

Commit

Permalink
fix: cjs deps are not properly loaded (#738)
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz authored Nov 14, 2023
1 parent 1130a8a commit 57ff5aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ module.exports = async function (env, argv) {
}
});

config.module.rules = config.module.rules.map((rule) => {
if (rule.oneOf instanceof Array) {
rule.oneOf[rule.oneOf.length - 1].exclude = [
/\.(js|mjs|jsx|cjs|ts|tsx)$/,
/\.html$/,
/\.json$/,
];
}
return rule;
});

// needed by solana libs
config.module.rules.unshift({
type: "javascript/auto",
Expand Down

0 comments on commit 57ff5aa

Please sign in to comment.