File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,9 +142,9 @@ const urls = [
142142
143143const currentLocation = 'https://github.com/fregante/shorten-repo-url/issue/1' ;
144144
145- const urlInput = document . getElementById ( ' url-input') ;
146- const output = document . getElementById ( ' output') ;
147- const examplesContainer = document . getElementById ( ' examples') ;
145+ const urlInput = document . querySelector ( '# url-input') ;
146+ const output = document . querySelector ( '# output') ;
147+ const examplesContainer = document . querySelector ( '# examples') ;
148148
149149function updateOutput ( url ) {
150150 if ( ! url ) {
@@ -154,7 +154,7 @@ function updateOutput(url) {
154154 }
155155
156156 const shortened = shortenUrl ( url , currentLocation ) ;
157-
157+
158158 if ( shortened ) {
159159 output . classList . add ( 'has-content' ) ;
160160 output . innerHTML = `
@@ -171,8 +171,8 @@ function updateOutput(url) {
171171}
172172
173173// Handle input changes
174- urlInput . addEventListener ( 'input' , ( e ) => {
175- updateOutput ( e . target . value ) ;
174+ urlInput . addEventListener ( 'input' , event => {
175+ updateOutput ( event . target . value ) ;
176176} ) ;
177177
178178// Initialize examples
Original file line number Diff line number Diff line change 3333 },
3434 "xo" : {
3535 "parser" : " @typescript-eslint/parser" ,
36+ "ignores" : [
37+ " demo/**"
38+ ],
3639 "globals" : [
3740 " document"
3841 ],
Original file line number Diff line number Diff line change @@ -4,16 +4,23 @@ import {defineConfig} from 'vite';
44
55const __dirname = fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
66
7- export default defineConfig ( {
8- base : '' ,
9- root : resolve ( __dirname , 'demo' ) ,
10- build : {
11- outDir : resolve ( __dirname , 'demo/dist' ) ,
12- emptyOutDir : true ,
13- rollupOptions : {
14- input : {
15- main : resolve ( __dirname , 'demo/index.html' ) ,
7+ export default defineConfig ( ( { command} ) => {
8+ if ( command === 'build' ) {
9+ return {
10+ base : '' ,
11+ root : resolve ( __dirname , 'demo' ) ,
12+ build : {
13+ outDir : resolve ( __dirname , 'demo/dist' ) ,
14+ emptyOutDir : true ,
15+ rollupOptions : {
16+ input : {
17+ main : resolve ( __dirname , 'demo/index.html' ) ,
18+ } ,
19+ } ,
1620 } ,
17- } ,
18- } ,
21+ } ;
22+ }
23+
24+ // Default config for test/serve
25+ return { } ;
1926} ) ;
You can’t perform that action at this time.
0 commit comments