diff --git a/package.json b/package.json index 189b5f2..efab398 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Run trained Keras models in your browser, GPU-powered using WebGL.", "scripts": { "lint": "standard src test", - "watch": "webpack src/index.js dist/keras.js --watch --config webpack.dev.config.js", + "watch": "webpack --watch --config webpack.dev.config.js", "build": "npm run lint && webpack --config webpack.prod.config.js", "server": "http-server . -p 3000" }, @@ -31,6 +31,8 @@ }, "homepage": "https://github.com/transcranial/keras-js#readme", "dependencies": { + "axios": "^0.14.0", + "bluebird": "^3.4.6", "cwise": "^1.0.9", "lodash": "^4.15.0", "ndarray": "^1.0.18", @@ -47,6 +49,7 @@ "babel-core": "^6.14.0", "babel-eslint": "^6.1.2", "babel-loader": "^6.2.5", + "babel-plugin-transform-async-to-module-method": "^6.8.0", "babel-plugin-transform-class-properties": "^6.11.5", "babel-plugin-transform-object-rest-spread": "^6.8.0", "babel-preset-latest": "^6.14.0", @@ -72,7 +75,14 @@ ], "plugins": [ "transform-class-properties", - "transform-object-rest-spread" + "transform-object-rest-spread", + [ + "transform-async-to-module-method", + { + "module": "bluebird", + "method": "coroutine" + } + ] ] } } diff --git a/webpack.dev.config.js b/webpack.dev.config.js index 40a2376..4d61f57 100644 --- a/webpack.dev.config.js +++ b/webpack.dev.config.js @@ -1,6 +1,17 @@ +const path = require('path') const webpack = require('webpack') module.exports = { + entry: [ + 'babel-polyfill', + path.join(__dirname, 'src/index') + ], + output: { + path: path.join(__dirname, 'dist'), + filename: 'keras.js', + library: 'KerasJS', + libraryTarget: 'umd' + }, devtool: 'cheap-module-eval-source-map', module: { loaders: [ @@ -11,10 +22,6 @@ module.exports = { } ] }, - output: { - library: 'KerasJS', - libraryTarget: 'umd' - }, resolve: { extensions: ['', '.js'] }, diff --git a/webpack.prod.config.js b/webpack.prod.config.js index 4ae24a8..c5c0932 100644 --- a/webpack.prod.config.js +++ b/webpack.prod.config.js @@ -1,6 +1,17 @@ +const path = require('path') const webpack = require('webpack') module.exports = { + entry: [ + 'babel-polyfill', + path.join(__dirname, 'src/index') + ], + output: { + path: path.join(__dirname, 'dist'), + filename: 'keras.min.js', + library: 'KerasJS', + libraryTarget: 'umd' + }, module: { loaders: [ { @@ -10,10 +21,6 @@ module.exports = { } ] }, - output: { - library: 'KerasJS', - libraryTarget: 'umd' - }, resolve: { extensions: ['', '.js'] },