Skip to content

Commit

Permalink
Merge pull request #200 from node-red-contrib/konne/try-with-import
Browse files Browse the repository at this point in the history
change: try with import for node-fetch
  • Loading branch information
konne authored Oct 8, 2022
2 parents c465d6e + b6e0acb commit edb421e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "A node-red node that makes the communication with BSB-Lan very easy",
"scripts": {
"build": "npx tsc -p tsconfig.backend.json && npm run tsc",
"build": "npx tsc",
"postbuild": "node tool/buildhtml.js",
"nodered": "npm run build && node-red",
"tsc": "tsc"
Expand Down
3 changes: 2 additions & 1 deletion src/bsb-lan-device.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NodeAPI, Node, NodeDef } from "node-red";
import { Credentials, BSBLanDeviceNodeConfig, BSBLanDeviceNode } from "./interfaces";

import fetch from "node-fetch";
// @ts-ignore
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));

export default function (RED: NodeAPI) {
function NodeConstructorBSBLanDevice(this: BSBLanDeviceNode, def: NodeDef & BSBLanDeviceNodeConfig) {
Expand Down
19 changes: 0 additions & 19 deletions tsconfig.backend.json

This file was deleted.

5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"sourceMap": false,
"strict": false,
"outDir": "./nodes/",
},
"include": [
"src/**/*.html.ts"
]
}
}

0 comments on commit edb421e

Please sign in to comment.