1- import { resolve } from "node:path" ;
1+ import { resolve } from "node:path"
22
3- import { defineConfig , Plugin } from "vite" ;
4- import Vue from "@vitejs/plugin-vue" ;
5- import mdiAttrs from "markdown-it-attrs" ;
6- import mdiHljs from "markdown-it-highlightjs" ;
7- import mdiReplaceLink from "markdown-it-replace-link" ;
8- import hljs from "highlight.js/lib/core" ;
9- import cpp from "highlight.js/lib/languages/cpp" ;
10- import json from "highlight.js/lib/languages/json" ;
3+ import { defineConfig , Plugin } from "vite"
4+ import Vue from "@vitejs/plugin-vue"
5+ import mdiAttrs from "markdown-it-attrs"
6+ import mdiHljs from "markdown-it-highlightjs"
7+ import mdiReplaceLink from "markdown-it-replace-link"
8+ import hljs from "highlight.js/lib/core"
9+ import cpp from "highlight.js/lib/languages/cpp"
10+ import json from "highlight.js/lib/languages/json"
1111
12- import TroubleshooterPlugin from "./plugins/troubleshooter" ;
12+ import TroubleshooterPlugin from "./plugins/troubleshooter"
1313
14- hljs . registerLanguage ( "cpp" , cpp ) ;
15- hljs . registerLanguage ( "json" , json ) ;
14+ hljs . registerLanguage ( "cpp" , cpp )
15+ hljs . registerLanguage ( "json" , json )
1616
1717// https://vitejs.dev/config/
1818export default defineConfig ( ( { mode } ) => ( {
1919 build : {
2020 lib : {
21- entry : resolve ( __dirname , "src/main.js " ) ,
21+ entry : resolve ( __dirname , "src/main.ts " ) ,
2222 formats : [ "iife" ] ,
2323 name : "ArduinoJsonTroubleshooter" ,
2424 fileName : ( format ) => "troubleshooter.js" ,
@@ -35,8 +35,8 @@ export default defineConfig(({ mode }) => ({
3535 markdownItOptions : {
3636 highlight ( str , lang ) {
3737 if ( lang && hljs . getLanguage ( lang ) )
38- return hljs . highlight ( str , { language : lang } ) . value ;
39- return "" ; // use external default escaping
38+ return hljs . highlight ( str , { language : lang } ) . value
39+ return "" // use external default escaping
4040 } ,
4141 } ,
4242 markdownItUses : [
@@ -48,12 +48,12 @@ export default defineConfig(({ mode }) => ({
4848 {
4949 replaceLink ( link : string ) {
5050 if ( mode == "development" )
51- return new URL ( link , "https://arduinojson.org" ) . href ;
52- else return link ;
51+ return new URL ( link , "https://arduinojson.org" ) . href
52+ else return link
5353 } ,
5454 } ,
5555 ] ,
5656 ] ,
5757 } ) ,
5858 ] ,
59- } ) ) ;
59+ } ) )
0 commit comments