mangony
mangony copied to clipboard
When not using jsx templater still get `Cannot find module 'react-dom/server'`
I would like to use the latest version of Mangony to build a markdown based static site. However, due to the plugin setup I'm forced to either install react-dom, or at least fake it :(
To reproduce, install mangony on a fresh repo, grab the 'prod' example from readme and run it. Even though using the hbsTemplaterPlugin
instead of the jsx templater, the plugin gets called and attempts (and fails) to import react-dom/server.
Work-around: Create a fake node_modules/react-dom/server.js that exports an empty object...
I will take a look today... Thx for highlighting it.
@windgazer Sry for the late reply. I have taken a look at it and you can easily work around this by using the direct import:
const Mangony = require('mangony/lib/mangony');
const HbsTemplater = require('mangony/lib/plugins/hbs-templater');
const ServerPlugin = require('mangony/lib/plugins/server');
This way the dependencies for other plugins are not loaded. I will add a peerDependency to the lib for installation hints. And I will update the docs for that.