In my app, I’m using the aws-iot-device-sdk on the api side as well as the web side. This module requires the fs and tls modules, thus I’m using the following Webpack config on the web side to mock those modules:
However, when using Storybook, it seems that the Webpack config from the web side is not loaded as I get these errors: Module not found: Error: Can't resolve 'fs' Module not found: Error: Can't resolve 'tls'
Adding the following lines to node_modules/@redwoodjs/core/config/storybook/main.js seems to fix this:
// ** NODE **
sbConfig.node = rwConfig.node
From what I gather, the user Webpack config is only partially merged with the sbConfig object in node_modules/@redwoodjs/core/config/storybook/main.js. This way the node mocking config would be carried over as well.
Hey @jderrough, sorry, I haven’t had a chance to look at it yet
From your assessment it looks like you’re 100% correct that we’re only doing partial merging of the configs. I believe I had issues merging those two configs. I would be amazing if you could open a PR that additionally merges the parts that are valuable to you.