From 9ddc9525292e1c0268f15974e91443cba2b6fa23 Mon Sep 17 00:00:00 2001 From: Miroslav Jancarik Date: Tue, 4 Jun 2024 11:06:17 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20update=20documenta?= =?UTF-8?q?iton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/register-custom-element.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/register-custom-element.md b/docs/docs/register-custom-element.md index 54c7edc3..9dfd2b69 100644 --- a/docs/docs/register-custom-element.md +++ b/docs/docs/register-custom-element.md @@ -44,7 +44,7 @@ export default function () { } ``` -The `@merkur/integration-custom-element/cli` modify default `@merkur/cli` configuration (chang playground widgetHandler to skip `/widget` request, turn off widget server because custom element works only in browser, turn off HMR and use hot reload instead, filter node platform tasks, force generated files to be saved to filesystem as writeToDisk = true, register css bundle plugin for including bundled css file to js). +The `@merkur/integration-custom-element/cli` modify default `@merkur/cli` configuration (change playground widgetHandler to skip `/widget` request, turn off widget server because custom element works only in browser, turn off HMR and use hot reload instead, filter node platform tasks, force generated files to be saved to filesystem as writeToDisk = true, register css bundle plugin for including bundled css file to js). ### Widget part @@ -80,7 +80,7 @@ export default { }; ``` -We add our resolved environment to widget `props.environment` property in `/src/widget.js`. Same as it works in default Merkur template. The custom element don't support Merkur slots. So we set `slotFactories` to empty array. Then you can remove `src/components/slots` folder. +We add our resolved environment to widget `props.environment` property in `/src/widget.js`. Same as it works in default Merkur template. The custom element don't support Merkur slots. So we set `slotFactories` to empty array. Then you can remove `src/components/slots` folder. If you want to inline css bundle to resulted JS file then add `import cssBundle from '@merkur/integration-custom-element/cssBundle'` and define `inlineStyle` asset with cssBundle as source. At the end register your widget as custom element with `registerCustomElement` method which alive widget and connect widget with custom element. ```javascript /* eslint-disable no-unused-vars */