Skip to content

Commit

Permalink
Create a reproduceable example of onnxjs + webpack breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
csaroff committed Jun 16, 2019
1 parent be6f6b5 commit a90769d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
12 changes: 11 additions & 1 deletion config/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,21 @@ module.exports = {
}
}],
exclude: /node_modules/
}, {
test: /\.node?$/,
use: [{
loader: 'node-loader',
options: {
compilerOptions: {
noEmit: false
}
}
}],
}
]
},
resolve: {
extensions: [".ts", ".js"]
extensions: [".ts", ".js", ".node"]
},
output: {
filename: "main.js",
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"md5.js": "^1.3.5",
"node-fetch": "^2.3.0",
"node-int64": "^0.4.0",
"onnxjs": "^0.1.7",
"onnxjs-node": "^0.4.1",
"rc-align": "^2.4.5",
"rc-checkbox": "^2.1.6",
"rc-menu": "^7.4.21",
Expand Down Expand Up @@ -118,6 +120,7 @@
"foreman": "^3.0.1",
"jest-enzyme": "^7.0.1",
"jquery": "^3.3.1",
"node-loader": "^0.6.0",
"node-sass": "^4.10.0",
"popper.js": "^1.14.6",
"redux-immutable-state-invariant": "^2.1.0",
Expand All @@ -128,7 +131,8 @@
"typescript": "^3.1.6",
"webpack": "^4.19.1",
"webpack-cli": "^3.1.2",
"webpack-merge": "^4.1.5"
"webpack-merge": "^4.1.5",
"worker-loader": "^2.0.0"
},
"engines": {
"node": ">=10.14.2",
Expand Down
2 changes: 2 additions & 0 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
} from "electron";
import { IpcMainProxy } from "./common/ipcMainProxy";
import LocalFileSystem from "./providers/storage/localFileSystem";
import { Tensor, InferenceSession } from "onnxjs-node";
const inferenceSession = new InferenceSession();

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand Down

0 comments on commit a90769d

Please sign in to comment.