Skip to content

riot.esm.js #2965

Answered by jbrozek
jbrozek asked this question in Q&A
Sep 19, 2022 · 4 comments · 3 replies
Discussion options

You must be logged in to vote

esbuild allowed me to create an riot.esm.js, below is an example if anyone would be assisted by this

npm install esbuild
.\node_modules\.bin\esbuild .\node_modules\riot\esm\riot.js --bundle --format=esm --outfile=riot.esm.js

that outfile can be directly used in the browser

<script type='module'>
    import * as riot from '/js/lib/riot.esm.js'; //generated from esbuild
    import raw from '/js/module-dist/riot/raw.js'; //generated from riot cli
    riot.component(raw)(document.querySelector('module'), { html: "<p class='container'>Raw Test</p>" });
</script>

where raw.riot is (pre riot cli)

<raw>
  <script>
    export default {
      setInnerHTML() {
        this.root.innerHTML = this.pr…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@GianlucaGuarini
Comment options

Comment options

You must be logged in to vote
1 reply
@GianlucaGuarini
Comment options

Comment options

You must be logged in to vote
1 reply
@GianlucaGuarini
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jbrozek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants