4 ms·
And to clarify, you should run this once by hand to collect the list, don't add the grepping to the actuall installation script or you are back to square one :D
by inbx0 5y ago
And to clarify, you should run this once by hand to collect the list, don't add the grepping to the actuall installation script or you are back to square one :D
Here's what I use with yarn, install.sh:
#!/usr/bin/env bash
yarn
function run_install() {
local dependency="node_modules/$1"
if [[ -d "$dependency" ]]; then
yarn --cwd "$dependency" run postinstall
fi
}
run_install 'esbuild'
run_install 'other_package'
...
- notpublic 5y agoGood point and nice script. I am going to use it in my projects. I wish package.json had an option where I could explicitly mark which packages can run postinstall scripts.
- dustyharddrive 5y ago> explicitly mark which packages can run postinstall scripts Here's an RFC on exactly that: https://github.com/npm/rfcs/discussions/80 https://github.com/npm/rfcs/discussions/80