I’m trying to import an npm module to Observable notebooks. I tried different ways to package the module. I used babel to build main/browser/module packages.
I also try to use webpack with babel-loader to build the npm package. Here’s the link to the current version:
vidajs@0.0.5
I compare the output code on unpkg.com. It looks similar to other packages like d3.
None of these versions can be imported to an Observable notebook. I can import them into a React project.
@radames thanks for the links. I tried a few things. When I bundle react with the library, Observable loads the library without errors. When I don’t bundle react with the library, I get “invalid module” with process.env. I think the common practice is to not bundle react.