Build script

This commit is contained in:
Hri7566 2023-09-15 06:51:29 -04:00
parent de4f6a2383
commit 120caf6b98
6 changed files with 39 additions and 13 deletions

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"arrowParens": "avoid",
"trailingComma": "none",
"tabWidth": 4
}

View File

@ -1,4 +0,0 @@
await Bun.build({
entrypoints: ["src/index.tsx"],
outdir: "./build",
});

View File

@ -1,11 +1,14 @@
{
"name": "mpp-saturn",
"module": "src/index.ts",
"type": "module",
"devDependencies": {
"bun-types": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
"name": "mpp-saturn",
"module": "src/index.ts",
"type": "module",
"scripts": {
"build": "bun scripts/build.ts"
},
"devDependencies": {
"bun-types": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}

13
scripts/build.ts Normal file
View File

@ -0,0 +1,13 @@
import fs from "fs";
await Bun.build({
entrypoints: ["src/index.tsx"],
outdir: "./build/index.js",
});
const userscriptHeader = fs
.readFileSync("scripts/userscriptHeader.js")
.toString();
const artifact = fs.readFileSync("build/index.js").toString();
fs.writeFileSync("build/Saturn.user.js", userscriptHeader + artifact);

View File

@ -0,0 +1,9 @@
// ==UserScript==
// @name Saturn
// @namespace MPP
// @match https://mppclone.com/*
// @grant none
// @version 1.0
// @author Hri7566, Foonix
// @description 9/15/2023, 6:42:49 AM
// ==/UserScript==

0
src/util/MPP.d.ts vendored Normal file
View File