1616 < title >
1717 simple browser rollup example
1818 </ title >
19+
1920 < meta name =description content ='Learn how to use Rollup directly in the browser with a live tool and example. Bundle JavaScript modules client-side without installing anything. '>
2021
22+ < base href ='https://ext-code.com/blog/25-08-31/simple-browser-rollup-example/ '>
23+ < link rel =canonical href ='https://ext-code.com/blog/25-08-31/simple-browser-rollup-example/simple-browser-rollup-example.html '>
2124
2225 < link rel =icon type ='image/png ' href ='/blog/image/blog-30.png '>
2326 < meta name =viewport content ='width=device-width, initial-scale=1 '>
2427
25-
26- < base href ='https://ext-code.com/blog/25-08-31/simple-browser-rollup-example/ '>
27- < link rel =canonical href ='https://ext-code.com/blog/25-08-31/simple-browser-rollup-example/simple-browser-rollup-example.html '>
28-
29-
3028 < script type ='application/ld+json '>
31-
3229 {
3330 "@context" : "https://schema.org" ,
3431 "@type" : "TechArticle" ,
4037 "mainEntityOfPage" : { "@type" :"WebPage" , "@id" :"https://ext-code.com/blog/25-08-31/simple-browser-rollup-example/simple-browser-rollup-example.html" } ,
4138 "publisher" : { "@type" :"Organization" , "name" :"ext-code.com" , "logo" :{ "@type" :"ImageObject" , "url" :"https://ext-code.com/favicon.ico" } } ,
4239 }
43-
4440 </ script >
4541
4642
47- <!--
48- //:
49- -->
50-
51-
5243 < script src ='https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js '> </ script >
5344
5445
5950 console . log ( 'simple-browser-rollup-example.html' ) ;
6051 console . log ( ) ;
6152 console . json = v => console . log ( JSON . stringify ( v , null , 4 ) ) ;
62- var version = 'v1.0' , df = true
53+ var df = true , version = 'v1.0'
6354 ;
6455
56+ var ace ;
6557
6658 var ext ;
6759 var $ ;
6860 var datatype ;
6961 var menumod ;
70- var code ;
62+ var keydown ;
7163 var debug ;
7264
7365
7466 var rollup ;
7567 var test ;
68+
69+
70+ var log ;
71+
7672
7773 //:
7874
8480
8581 rollup = mod . rollup ;
8682 test = mod . test ;
83+ log = mod . log ;
8784
8885 rollup . initmod ( { ext, $, ace, menu} ) ;
8986 test . initmod ( { ext, $, ace, menu} ) ;
87+ log . initmod ( { ext, $} ) ;
9088
9189 await Promise . all ( [
9290 rollup . init ( ) ,
9391 test . init ( ) ,
92+ log . init ( ) ,
9493 ] ) ;
9594
9695
97- await initdom ( document . body ) ;
96+ initdom ( document . body ) ;
9897
9998
10099 } //init
114113 'js/core/datatype.js' ,
115114 'js/dom/menumod/menumod.js' ,
116115 'js/dom/keydown/keydown.js' ,
117- 'js/dom/code/v2.0/code-v2.0.js.api' ,
118116 'js/debug/debug.js' ,
119117 ) ;
120118 [ $ , datatype , menumod , keydown , code ] = await promise ;
121119
122- code . initmod ( { ext, $, datatype, menumod} ) ;
123-
124120 mod . stack . complete ;
125121
126122} ) ( ) ;
136132 html
137133 {height : 100% ;font-family : arial}
138134 body
139- {min-height : calc (100% - 40px );display : flex;flex-direction : column;gap : 10 px ;margin : 20px ;align-items : center;
135+ {min-height : calc (100% - 40px );display : flex;flex-direction : column;gap : 20 px ;margin : 20px ;align-items : center;
140136 padding-bottom : 200px ;
141137 }
142138 body > *
143- {max-width : 1400px ;width : 100% ;padding : 0 20px ;}
139+ {max-width : 1400px ;width : 100% }
140+
141+ [component ]
142+ {display : none}
143+
144+ .description
145+ {max-width : 1000px ;text-align : justify;border-left : 4px solid # 4a90e2 ;padding : 1rem 2rem ;
146+ background-color : # f9f9f9 ;font-family : system-ui, sans-serif;font-size : 1rem ;line-height : 1.6 ;color : # 333 }
147+ .description > p
148+ {margin : 0 }
149+ .description > p + p
150+ {margin : 10px 0 }
151+
152+ code
153+ {font-family : monospace;background : whitesmoke}
154+ code .inline
155+ {display : inline;padding : 5px 10px }
156+
157+ a
158+ {color : # 4a90e2 ;text-decoration : none;font-weight : 500 }
159+ a : hover
160+ {text-decoration : underline}
161+ .link-domain
162+ {font-size : 0.85rem ;color : # 777 ;margin-left : 0.25rem }
163+ .link-domain ::before
164+ {content : '[' }
165+ .link-domain ::after
166+ {content : ']' }
167+ .link-txt
168+ {}
169+
170+ input
171+ {font-size : 16px ;padding : 5px 7px ;box-sizing : border-box;}
172+ input [type = button ]
173+ {cursor : pointer}
174+
175+
144176
145177
146178 # rollup
153185 {font-size : 12px }
154186 .link-txt
155187 {}
188+
156189
157190 </ style >
158191
159-
160192 </ head >
161193
162194
@@ -174,46 +206,47 @@ <h1 class=title>
174206
175207
176208
177- < div id =description >
178-
179- demonstrates how to use
180- < a href ='https://rollupjs.org/ '>
181- < span class =link-domain >
182- [ rollupjs.org ]
183- </ span >
184- < span class =link-text >
185- rollup
186- </ span >
187- </ a >
188- in a browser to rollup nodejs libraries for client side use
209+ < div class =description >
210+
211+ < p >
212+ Learn how to use Rollup directly in the browser with a live tool and example.
213+ Bundle JavaScript modules client-side without installing anything.
214+
215+ < a href ='https://rollupjs.org/ '>
216+ < span class =link-domain >
217+ rollupjs.org
218+ </ span >
219+ < span class =link-text >
220+ rollup
221+ </ span >
222+ </ a >
223+
224+ in a browser to rollup nodejs libraries for client side use
225+ </ p >
189226
190227 </ div >
191228
229+
192230 < snippet-html-console id =rollup component v2.0 src ='webcontainer-rollup.html '> </ snippet-html-console >
193231
194232
195233 < div >
196-
197234 if you download the espree.m.js code and host it on a local server, you can use the following the code to test it
198-
199-
200235 </ div >
201236
202237
203238 < snippet-html-console id =test component v2.0 src ='test.html '> </ snippet-html-console >
204239
205240
206-
207-
208-
209241 </ body >
210242
211243
212244 < script >
213245
214246
215-
216-
247+ //:
248+
249+
217250 async function initdom ( rootnode ) {
218251
219252 var root = rootnode ;
@@ -223,12 +256,13 @@ <h1 class=title>
223256 test . initdom ( ) ;
224257
225258
259+ log . initdom ( ) ;
260+
261+
226262 } //initdom
227263
228264
229265 </ script >
230-
231-
232266
233267</ html >
234268
0 commit comments