From beff86e8b1437cb953c2d2433e4d27d8e06ea3f3 Mon Sep 17 00:00:00 2001 From: Sebastian Felis Date: Sun, 21 Feb 2021 11:07:57 +0100 Subject: [PATCH] Add node-cpu build for non supported systems of libtensorflow --- server/build.js | 18 ++++++++++++++++++ src/tfjs/tf-node-cpu.ts | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100644 src/tfjs/tf-node-cpu.ts diff --git a/server/build.js b/server/build.js index 1395a07..0b10e32 100644 --- a/server/build.js +++ b/server/build.js @@ -88,6 +88,24 @@ const targets = { external: ['@tensorflow'], }, }, + nodeCPU: { + tfjs: { + platform: 'node', + format: 'cjs', + metafile: 'dist/tfjs.esm.json', + entryPoints: ['src/tfjs/tf-node-cpu.ts'], + outfile: 'dist/tfjs.esm.js', + external: ['@tensorflow'], + }, + node: { + platform: 'node', + format: 'cjs', + metafile: 'dist/face-api.node-cpu.json', + entryPoints: ['src/index.ts'], + outfile: 'dist/face-api.node-cpu.js', + external: ['@tensorflow'], + }, + }, browserNoBundle: { tfjs: { platform: 'browser', diff --git a/src/tfjs/tf-node-cpu.ts b/src/tfjs/tf-node-cpu.ts new file mode 100644 index 0000000..988803d --- /dev/null +++ b/src/tfjs/tf-node-cpu.ts @@ -0,0 +1,6 @@ +/* eslint-disable import/no-extraneous-dependencies */ +/* eslint-disable node/no-unpublished-import */ + + +export * from '@tensorflow/tfjs'; +