Skip to content

Commit

Permalink
add platform flag to esbuild; update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hanayik committed Jul 18, 2023
1 parent 968fd76 commit 50632f7
Show file tree
Hide file tree
Showing 6 changed files with 3,508 additions and 3,455 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ A JavaScript [NIfTI](http://nifti.nimh.nih.gov/) file format reader. This reade
### Usage
[API](https://github.com/rii-mango/NIFTI-Reader-JS/wiki/API), [drawing to canvas example](https://github.com/rii-mango/NIFTI-Reader-JS/blob/master/tests/canvas.html) and [more](https://github.com/rii-mango/NIFTI-Reader-JS/tree/master/tests)

Using in a HTML `script` tag to emulate older behaviour prior to the esbuild changes in `v0.6.4`:

```html
<script type="module">
import * as nifti from './nifti-reader.js';
window.nifti = nifti.default;
console.log(nifti);
</script>
```


```javascript
var data = // an ArrayBuffer
var niftiHeader = null,
Expand Down
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@
"version": "0.6.6",
"description": "A JavaScript NIfTI file format reader.",
"main": "dist/src/nifti.js",
"browser": "release/current/nifti-reader.js",
"unpkg": "release/current/nifti-reader.js",
"types": "dist/src/nifti.d.ts",
"directories": {
"test": "tests"
},
"files": [
"release/current/*.js",
"dist/src/*.js",
"dist/src/*.d.ts",
"dist/src/*.js.map",
"dist/src/*.ts",
"src/*.js",
"src/*.d.ts",
"src/*.js.map",
"src/*.ts"
],
"dependencies": {
"fflate": "*"
},
Expand All @@ -24,7 +37,7 @@
"scripts": {
"test": "mocha -r ts-node/register __tests__/**/*.spec.ts",
"test-js": "npm run build; npm run release; mocha --timeout 0 tests",
"build": "rm -rf build; mkdir build; tsc; esbuild dist/src/nifti.js --bundle --outfile=build/nifti-reader.js; esbuild dist/src/nifti.js --bundle --minify --outfile=build/nifti-reader-min.js",
"build": "rm -rf build; mkdir build; tsc; esbuild dist/src/nifti.js --bundle --outfile=build/nifti-reader.js --platform=neutral; esbuild dist/src/nifti.js --bundle --minify --outfile=build/nifti-reader-min.js --platform=neutral",
"release": "rm release/current/*.js; cp build/*.js release/current/.",
"doc": "rm -rf build; mkdir build; ./node_modules/.bin/jsdoc2md dist/src/*.js > build/docs.md"
},
Expand Down
6 changes: 3 additions & 3 deletions release/current/nifti-reader-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 50632f7

Please sign in to comment.