Skip to content

Commit

Permalink
fix: ant-design chart visualisation canvas issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yld-weng committed Mar 21, 2022
1 parent 9b57205 commit 73ad9d6
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 131 deletions.
36 changes: 19 additions & 17 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,30 @@ exports.onCreateWebpackConfig = ({ actions, stage, loaders }) => {
}
},
module: {
rules: [
{
/* prevent error from canvas used by trianglify:
* error Generating SSR bundle failed Unexpected character '' (1:0) & (1:2)
*/
test: /canvas/,
use: loaders.null()
}
]
rules: []
}
};

if (stage === "build-html") {
webpackConfig.module.rules.push(
// WebpackError: ReferenceError: ResizeObserver is not defined
{
test: /@nivo\/core/,
use: loaders.null()
}
);
if (stage === "develop-html" || stage === "build-html") {
webpackConfig.module.rules.push({
/* prevent error from canvas used by trianglify:
* error Generating SSR bundle failed Unexpected character '' (1:0) & (1:2)
*/
test: /canvas/,
use: loaders.null()
});
}

// if (stage === "build-html") {
// webpackConfig.module.rules.push(
// // WebpackError: ReferenceError: ResizeObserver is not defined
// {
// test: /@nivo\/core/,
// use: loaders.null()
// }
// );
// }

actions.setWebpackConfig(webpackConfig);
};

Expand Down
Loading

0 comments on commit 73ad9d6

Please sign in to comment.