Skip to content

Commit

Permalink
Use swc for faster typescript compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Nov 18, 2024
1 parent 1335580 commit 801aab3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default (eleventyConfig) => {
};

const compileTS = () => {
return run("tsc");
//return run("tsc");
return run(`swc --out-dir ${dir.output} src/scripts/*.ts`);
};
const generateAtomFeed = () => {
return run(`npm run -w atom_generator generate -- -i ../${dir.output}/news.html -o ../${dir.output}/news_feed.atom`);
Expand Down
11 changes: 11 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "es2022"
},
"module": {
"type": "commonjs"
}
}
15 changes: 8 additions & 7 deletions _site/scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
"use strict";
document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("DOMContentLoaded", ()=>{
const distroSelect = document.getElementById("distroSelect");
const showOption = (element) => {
const hideOptionDivs = (element) => {
for (const option of element.options)
document.getElementById(`${option.value}Div`)?.classList.add("invisible");
const showOption = (element)=>{
const hideOptionDivs = (element)=>{
for (const option of element.options)document.getElementById(`${option.value}Div`)?.classList.add("invisible");
};
// reset all
if (element.id === "OSSelect") {
hideOptionDivs(element);
distroSelect.value = "emptyDist";
}
hideOptionDivs(distroSelect);
// show selected
document.getElementById(`${element.value}Div`)?.classList.remove("invisible");
};
const osSelect = document.getElementById("OSSelect");
osSelect.addEventListener("change", (_event) => {
osSelect.addEventListener("change", (_event)=>{
showOption(osSelect);
});
osSelect.value = "emptyOS";
distroSelect.addEventListener("change", (_event) => {
distroSelect.addEventListener("change", (_event)=>{
showOption(distroSelect);
});
distroSelect.value = "emptyDist";
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"stylelint": "*",
"stylelint-config-standard": "*",
"stylelint-order": "*",
"swc": "*",
"typescript": "*",
"typescript-eslint": "*"
},
Expand Down

0 comments on commit 801aab3

Please sign in to comment.