I am trying to use assemblyscript for charting visualization. I am unable to import d3.js modules in my library. I am getting compilation error.
package.json
"name": "ts-demo-5",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"prepare": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/d3": "^7.4.0",
"d3": "^7.8.3",
"ts-loader": "^9.4.2",
"typescript": "^5.0.2",
"webpack": "^5.76.3",
"webpack-cli": "^5.0.1",
"assemblyscript": "^0.27.1"
}
}
tsconfig.json
"extends": "assemblyscript/std/assembly.json",
"compilerOptions": {
"strictBindCallApply": false
},
"exclude": [
"node_modules",
"dist"
],
"include": [
"./src",
"./*"
]
}
asconfig.json
"targets": {
"debug": {
"outFile": "dataprocessor.wasm",
"textFile": "dataprocessor.wat",
"sourceMap": true,
"debug": true
}
},
"options": {
"bindings": "esm"
}
}
In my dataprocessor.ts, I have added dependency like,
import * as d3_scale from 'd3-scale';
For compiling to wasm, I use assemblyscript
asc src/processor/dataprocessor.ts --target debug
I am getting error
TS6054: File '~lib/d3-scale.ts' not found.
Please help if I missed any config here. Unable to figure out why its linkng to ~lib/d3-scale.ts.
Here I am using typescript version of d3 only.
How to import thirdparty npm package in assemblyscript?
Please suggest.