I want to learn D3 library. So I've installed it via npm. After a while I encountered an issue while applying transition on a svg object (see my original question here: transision() causes Uncaught TypeError with D3 version 7.2.1). I was adviced to bundle up the library to solve the issue.
I've been struggling with bundling D3 library using browserify. I've done these steps:
- Used require function in a module file and give it as an argument the library name ("d3")
- Referenced the module file and bundle.js file in a html document
- In a directory containing the module file ran command: browserify module.js > bundle.js
After I ran the command I got this:
....\node_modules\d3\src\index.js:1 export * from "d3-array"; ^ ParseError: 'import' and 'export' may appear only with 'sourceType: module'
I'm completely clueless what I'm doing wrong.