From dde7d10e4f9b271ac9b2af4586850b3d0618a89f Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Tue, 19 Apr 2022 17:26:04 -0500 Subject: [PATCH] added build script --- .gitignore | 1 + package.json | 3 ++- src/index.ts | 2 +- tsconfig.json | 6 ++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c2658d7..204ade5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +bin/ diff --git a/package.json b/package.json index 0eee3a8..dfc58ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "scripts": { - "start": "ts-node --project tsconfig.json src/index.ts" + "build": "tsc --project tsconfig.json", + "start": "node bin/index.js" }, "dependencies": { "i2c-bus": "^5.2.2", diff --git a/src/index.ts b/src/index.ts index f90349f..cbe0384 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import { openSync } from 'i2c-bus'; -import Oled = require('oled-i2c-bus'); +import Oled from 'oled-i2c-bus'; const i2cbus = openSync(1); const opts = { diff --git a/tsconfig.json b/tsconfig.json index 3ccbc62..7477e4c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,13 +12,15 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, + "esModuleInterop": true, "paths": { - "*": ["@types/*"] + "*": ["./@types/*"] }, "typeRoots": [ "./node_modules/@types", "./@types" - ] + ], + "outDir": "./bin" }, "include": ["src/**/*"] }