add npm script

This commit is contained in:
Hamcha 2023-08-24 16:49:16 +02:00
parent eb5e78346e
commit 536eb76dce
Signed by: hamcha
GPG Key ID: 1669C533B8CF6D89
5 changed files with 33 additions and 3 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
dist/
dist/
npm/

1
.npmrc Normal file
View File

@ -0,0 +1 @@
@hamcha:registry=https://git.fromouter.space/api/packages/hamcha/npm/

View File

@ -1 +1 @@
export * from "./makeDOM";
export * from "./makeDOM.ts";

27
scripts/npm.ts Normal file
View File

@ -0,0 +1,27 @@
import { build, emptyDir } from "https://deno.land/x/dnt@0.38.1/mod.ts";
await emptyDir("./npm");
await build({
entryPoints: ["./domutil.ts"],
outDir: "./npm",
shims: {},
esModule: true,
compilerOptions: {
lib: ["ES2017", "DOM"],
},
package: {
name: "@hamcha/domutil",
version: Deno.args[0],
description: "Cursed DOM microlibrary",
license: "AGPL-3.0",
repository: {
type: "git",
url: "git+https://git.fromouter.space/Hamcha/domutil",
},
},
postBuild() {
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync(".npmrc", "npm/.npmrc");
},
});

View File

@ -14,8 +14,9 @@
"alwaysStrict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"allowImportingTsExtensions": true,
"outDir": "./dist",
"lib": ["ES2017", "dom"]
},
"exclude": ["dist", "scripts"],
"exclude": ["dist", "scripts", "npm"],
}