Closed secretshardul closed 3 years ago
Awesome thanks!
@armaniferrante using yarn
inside the prepare script has a drawback. Installs fail if the local machine doesn't have yarn. I'm currently facing this on Netlify. I made it work by using "prepare": "npm run build"
.
I don't think npm run build
is a good option, since the module uses yarn. How about replicating the contents of the build script directly?
"build": "rm -rf dist && tsc --build tsconfig.json",
"prepare": "tsc --build tsconfig.json"
Is there a good reason to not just force people to install yarn? I'm fine with that.
Netlify's CI/CD breaks. It either runs Yarn or NPM, not both. I've raised a ticket, but here's what works currently:
package-lock.json
and migrate project to yarn; orI've made PR #54 to resolve this
@armaniferrante using
yarn
inside the prepare script has a drawback. Installs fail if the local machine doesn't have yarn. I'm currently facing this on Netlify. I made it work by using"prepare": "npm run build"
.I don't think
npm run build
is a good option, since the module uses yarn. How about replicating the contents of the build script directly?"build": "rm -rf dist && tsc --build tsconfig.json", "prepare": "tsc --build tsconfig.json"
NPM allows you to install modules directly from Github, which is useful for testing forks. Syntax:
The build files for this repo go in the
dist
folder, which is not committed in version control. This breaks the intended behaviour of the above script. Thedist
folder does not get added tonode_modules
.This can be remedied with a
prepare
script. These scripts are run on client side when modules are installed from github.Source: https://stackoverflow.com/a/50490565/7721443