-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run install scripts in pnpm@10
#388
Comments
This is probably the best solution for now if pnpm is being used I do think it'd be nice to be able to set this globally in addition to being able to set it on a per-project basis: pnpm/pnpm#8891 |
The @hyunbinseo what does pnpm 10 do if you don't set this option? |
This is the full log using
corepack use pnpm@10
I don't think the
{
"pnpm": {
"onlyBuiltDependencies": ["@sveltejs/kit", "esbuild"]
}
} corepack use pnpm@10 At this point, |
You need to have that setting in your
Yes, that is the right solution. |
That is what I've done in the above comment. (in the latter part)
|
I hate windows! I'm unable to update my Is anyone able to confirm that this works as expected #395 ?
|
It seems to work. I checked the "ignoredBuilds" array inside "node_modules/.modules.yaml" and it doesn't contain any elements. So, the dependencies were built. (We will also add a separate command for listing any ignored builds) |
It's not working because of pnpm's side-effects cache. We'd also need to disable that in the |
What is the problem with pnpm's side-effects cache? I don't think I have noticed any issues with side effects cache and esbuild. We have esbuild in pnpm's monorepo as a dependency with side-effects enabled. |
The problem isn't with esbuild, but with SvelteKit. SvelteKit's |
Could your template also add a prepare script that runs the required script from sveltekit? That feels like the right way to do it as it looks like sveltekit's postinstall is not intended for building sveltekit but for preparing some things in the dependent project. This is somewhat similar to Alternatively, maybe we could support some field in package.json that would tell pnpm not to use side-effects cache for the given package (it would be a field in sveltekit itself). IMO the prepare script would be better but we can discuss it with more people. |
In terms of lifecycle, We could potentially move the |
Yes, if you run your dependency's script from the prepare script of the project, then it won't use any side-effects cache, and it won't require changes to onlyBuiltDependencies |
What about if we run it from the project's |
It will work from any script of the project. So, Also, this solution will work with every package manager, not just pnpm. |
Thank you for the help and advice. I've sent a PR to remove SvelteKit's I recommended users to add a If sveltejs/kit#13304 is merged, we should update the template in this repo to contain a |
I put together a PR, which actually uses the |
In
pnpm@10
, install scripts must be individually enabled.If not, the following message will be logged.
What if this field is added to the
package.json
if the user selects pnpm?The text was updated successfully, but these errors were encountered: