Skip to content
Merged

Webpack #1213

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions lib/webpack-exports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var autotune_prep = require('./autotune-prep');
var autotune = require('./autotune');

function run_autotune(inputs) {
var prep_inputs = {
history: inputs.treatments,
profile: inputs.profile,
pumpprofile: inputs.pump_profile,
glucose: inputs.glucose_entries,
carbs: {},
categorize_uam_as_basal: inputs.categorize_uam_as_basal,
tune_insulin_curve: inputs.tune_insulin_curve
};
var prepped_glucose = autotune_prep(prep_inputs);
var autotune_inputs = {
preppedGlucose: prepped_glucose,
previousAutotune: inputs.autotune_profile,
pumpProfile: inputs.pump_profile
}
var autotune_result = autotune(autotune_inputs);
return autotune_result;
}

module.exports = {
run_autotune: run_autotune
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "openaps oref0 reference implementation of the reference design",
"scripts": {
"test": "make test",
"global-install": "npm install && sudo npm link && sudo npm link oref0 && sudo npm install -g"
"global-install": "npm install && sudo npm link && sudo npm link oref0 && sudo npm install -g",
"webpack": "webpack"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -110,7 +111,9 @@
"istanbul": "^0.4.4",
"mocha": "^5.2.0",
"mocha-lcov-reporter": "^1.2.0",
"should": "^7.1.0"
"should": "^7.1.0",
"webpack": "^4.28.3",
"webpack-cli": "^3.2.0"
},
"config": {
"blanket": {
Expand Down
13 changes: 13 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var path = require('path');
var webpack = require('webpack');
module.exports = {
mode: 'production',
entry: './lib/webpack-exports.js',
target: 'node',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js',
libraryTarget: 'var',
library: 'OpenAPS'
}
};