4 ms·
Question: For codebases that are all about package managers Yarn, what's best practice for integrating something like this? Just push it into a 'vendor' folder?
by boffinism 9y ago
Question: For codebases that are all about package managers Yarn, what's best practice for integrating something like this? Just push it into a 'vendor' folder?
- paultannenbaum 9y agoYou would have to dive into how the library was implemented and see if it is compatible as a node module. There is an issue right here in the repo you can follow: https://github.com/frappe/charts/issues/6 https://github.com/frappe/charts/issues/6
- pratu16x7 9y agoUpdate: https://www.npmjs.com/package/frappe-charts https://www.npmjs.com/package/frappe-charts
- TheAceOfHearts 9y agoIt depends on how the library is implemented, so you're expected to look at the source. If you're using something like Webpack and the library just places everything on the global scope, you can configure exports-loader [0]. That way you can reference the module as if it were written with CJS or ESM, without having to change the source. If it's not published on npm, you can reference the git repo along with the specific release tag you want to use. My suggestion would be to fork the repo and point to your fork in package.json, so things continue to work if the original repo ever gets taken down. [0] https://webpack.js.org/loaders/exports-loader/ https://webpack.js.org/loaders/exports-loader/