Created
July 30, 2020 18:55
-
-
Save ziyuang/30f135a2405bbeeb004fe4c8a05e8f5c to your computer and use it in GitHub Desktop.
Reproducing `hdf5.File is not a constructor`
This file contains hidden or 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
import { hdf5 } from 'hdf5'; | |
import { Access } from 'hdf5/lib/globals'; | |
let f = new hdf5.File('test.hdf5', Access.ACC_RDONLY); |
This file contains hidden or 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
{ | |
"name": "hdf5_test", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"hdf5": "https://github.com/HDF-NI/hdf5.node#v12" | |
}, | |
"devDependencies": { | |
"file-loader": "^6.0.0", | |
"webpack": "^4.44.1", | |
"webpack-cli": "^3.3.12" | |
} | |
} |
This file contains hidden or 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
const path = require('path'); | |
module.exports = { | |
entry: './index.js', | |
target: 'node', | |
module: { | |
rules: [ | |
{ | |
test: /\.node$/, | |
use: 'file-loader' | |
}, | |
], | |
}, | |
mode: 'development', | |
output: { | |
filename: 'index.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment