-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for Matlab built-in libraries in wasm
- Loading branch information
0 parents
commit 3878882
Showing
12 changed files
with
3,675 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
const gulp = require('gulp') | ||
const shell = require('gulp-shell') | ||
const express = require('express') | ||
const colors = require('colors'); | ||
const PORT = 8000; | ||
gulp.task('compile', () => { | ||
return gulp.src('./src/*.wat', {read: false}) | ||
.pipe(shell([ | ||
'./run_wasm.sh <%= file.path %>' | ||
])) | ||
}) | ||
gulp.task('compile-browser', () => { | ||
return gulp.src('./src/*.wat', {read: false}) | ||
.pipe(shell([ | ||
'./run_wasm_browser.sh <%= file.path %>' | ||
])) | ||
}) | ||
gulp.task('default',()=>{ | ||
return gulp.watch('./src/*.wat',['compile']) | ||
}); | ||
gulp.task('browser',()=>{ | ||
startServer(PORT,()=> | ||
{ | ||
console.log("Server started at 8000!"); | ||
return gulp.watch('*.wat',['compile-browser']); | ||
}); | ||
}); | ||
|
||
function startServer(port, callback){ | ||
const app = express() | ||
express.static.mime.types['wasm'] = 'application/wasm' | ||
app.use(express.static('./test/browser/')) | ||
app.get('/result',(req, res)=>{ | ||
console.log(String(req.query.timing).bgGreen.white); | ||
res.send("Done!"); | ||
// process.exit(0); | ||
}); | ||
app.listen(port, callback); | ||
} |
Oops, something went wrong.