![]() I’ve tried installing these packages with alias names but can’t be used in aliases so that didn’t work. "axios": "link both work but both feel a bit smelly. ![]() ![]() In package.json use postinstall scripts to symlink the versioned package names with link, e.g.In unit tests I then require('axios') and set it in the global, so the require in the main script isn’t invoked. In the script, check if the client is in global and, if not, use and add it to global.in unit tests) you’ll get an error, because if you npm install it’ll install to node_modules/axios, not tried a couple of approaches to work around the issue: The trouble is that by default if you run the code locally (e.g. For example, for Axios, you can use any of the following: you can just use require('axios') and a version of Axios is imported, though I prefer to define this explicitly so I can feel confident the default version won’t change under me and potentially break something. ![]() The canirequire site provides snippets showing how the version should be included in the require function in order to specify a particular version of a library to use. Does anyone have any insight on how the require logic is implemented in the sandbox environments used for rules, hooks and custom DB scripts, and how this can be replicated locally? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |