Skip to content

Commit 4fa7b07

Browse files
committed
Convert entry file to TypeScript
1 parent 007b5c0 commit 4fa7b07

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
<script src="https://arduinojson.org/node_modules/jquery/dist/jquery.slim.min.js"></script>
2222
<script src="https://arduinojson.org/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
23-
<script type="module" src="/src/main.js"></script>
23+
<script type="module" src="/src/main.ts"></script>
2424
</body>
2525

2626
</html>
File renamed without changes.

vite.config.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
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/
1818
export 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

Comments
 (0)