diff --git a/platform/ui/gatsby-node.js b/platform/ui/gatsby-node.js index 0efa56fe8..5238c944c 100644 --- a/platform/ui/gatsby-node.js +++ b/platform/ui/gatsby-node.js @@ -2,8 +2,25 @@ const path = require('path'); // ~~ Plugins const PnpWebpackPlugin = require(`pnp-webpack-plugin`); // Required until Webpack@5 -exports.onCreateWebpackConfig = args => { - args.actions.setWebpackConfig({ +exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => { + if (stage === 'build-html' || stage === 'develop-html') { + actions.setWebpackConfig({ + module: { + rules: [ + { + test: /\@ohif\/core/, + use: loaders.null(), + }, + { + test: /cornerstone\-math/, + use: loaders.null(), + }, + ], + }, + }); + } + + actions.setWebpackConfig({ node: { fs: 'empty' }, resolve: { plugins: [PnpWebpackPlugin], @@ -14,9 +31,6 @@ exports.onCreateWebpackConfig = args => { // .docz 'node_modules', ], - // resolve: { - // symlinks: true, - // }, }, resolveLoader: { plugins: [PnpWebpackPlugin.moduleLoader(module)],