A simple adapter for Ragu Server - A micro-frontend framework.
yarn add webpack ragu-cli ragu-simple-adapter
Create a file that renders your component:
// my-mfe.js
module.exports = () => ({
html: 'Hello, World'
})
After, start the ragu server specifying your adapter:
yarn ragu-cli dev --file my-mfe.js --adapter simple
Open your browser at http://localhost:3100/preview to check your micro-frontend live!
That's all!
yarn ragu-cli static --file my-mfe.js --baseurl https://mycdnhost/mymfe --output production --adapter simple
It will create a directory called production
with a file called index.json
.
<head>
<script src="https://cdn.jsdelivr.net/npm/ragu-dom@latest/ragu-dom.js" crossorigin="anonymous"></script>
<script>RaguDOM.registerRaguComponent();</script>
</head>
<body>
<ragu-framework src="https://mycdnhost/mymfe/index.json"></ragu-framework>
</body>
Check The docs for More: https://ragu-framework.github.io/#!/ragu-simple-adapter