Files
divkit/client/web/divkit-examples/globals-esm
2022-11-23 12:06:10 +03:00
..
2022-08-26 03:52:29 +03:00
2022-08-26 03:52:29 +03:00
2022-11-23 12:06:10 +03:00
2022-11-23 12:06:10 +03:00
2022-08-26 03:52:29 +03:00

Render DivJson inside browser without build using ES modules

Install the packages first:

npm сi

To work, these 2 files are included in the page:

  • @divkitframework/divkit/dist/client.css
  • @divkitframework/divkit/dist/esm/client.mjs

Using these files, you can render DivJson as follows:

import {render} from './node_modules/@divkitframework/divkit/dist/esm/client.mjs';

render({
    id: 'test',
    target: element,
    json: {}
});