mirror of
https://github.com/wassname/keras-js.git
synced 2026-09-10 12:15:12 +08:00
enable async and update webpack config
This commit is contained in:
+12
-2
@@ -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"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+11
-4
@@ -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']
|
||||
},
|
||||
|
||||
+11
-4
@@ -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']
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user