-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Generate Production package.json when building #5849
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
Comments
This sounds like a duplicate of #3176 |
@benmccann It's not the same. I don't propose bundling the dependencies as not all can be bundled. My proposal merely converts this (example from my current project): {
...
"devDependencies": {
"@felte/reporter-svelte": "1.1.2",
"@felte/validator-vest": "1.0.9",
"@playwright/test": "1.24.2",
"@prisma/client": "4.1.1",
"@sveltejs/adapter-node": "1.0.0-next.85",
"@sveltejs/kit": "1.0.0-next.401",
"@tailwindcss/forms": "0.5.2",
"@tailwindcss/typography": "0.5.4",
"@types/nodemailer": "6.4.4",
"@typescript-eslint/eslint-plugin": "5.31.0",
"@typescript-eslint/parser": "5.31.0",
"autoprefixer": "10.4.8",
"eslint": "8.21.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-svelte3": "4.0.0",
"felte": "1.2.2",
"form-data": "4.0.0",
"got": "12.3.0",
"mdsvex": "0.10.6",
"nodemailer": "6.7.7",
"paseto": "3.1.0",
"postcss": "8.4.14",
"postcss-load-config": "4.0.1",
"prettier": "2.7.1",
"prettier-plugin-svelte": "2.7.0",
"promise-retry": "2.0.1",
"soap": "0.45.0",
"svelte": "3.49.0",
"svelte-check": "2.8.0",
"svelte-preprocess": "4.10.7",
"tailwindcss": "3.1.7",
"tslib": "2.4.0",
"typescript": "4.7.4",
"vest": "4.5.0",
"vite": "3.0.4"
},
...
} to this: {
...
"dependencies": {
"@felte/validator-vest": "1.0.9",
"@prisma/client": "4.1.1",
"form-data": "4.0.0",
"got": "12.3.0",
"nodemailer": "6.7.7",
"paseto": "3.1.0",
"soap": "0.45.0",
"vest": "4.5.0"
}
...
} I tried using |
Why can't they? How do you figure out which can and can't? |
I don't know why they can't. I just know that they aren't. {
...
"dependencies": {
"@felte/validator-vest": "1.0.9",
"@prisma/client": "4.1.1",
"form-data": "4.0.0",
"got": "12.3.0",
"nodemailer": "6.7.7",
"paseto": "3.1.0",
"soap": "0.45.0",
"vest": "4.5.0"
}
...
}
The vite compiler already figures that out when it alters the imports to some relative path or keeps them untouched. You can look at the changes here, or I can just create the pull request. It is actually a small (I think) change and probably won't interfere with the big routing changes. |
Can you file an issue with a reproduction for this? It seems like we should fix this bug in Vite rather than work around it in SvelteKit |
I don't understand the fixation on One year ago it was a default in createSvelte and has been removed (see #1016) because of issues. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the problem
It's not always clear which packages should go into dependencies and which ones into devDependencies. There are regular new questions about this topic.
Describe the proposed solution
The compiler has all the information about which packages can be inlined and which can't. It can create a minimal production package.json file which only inludes the necessary packages.
Alternatives considered
No response
Importance
would make my life easier
Additional Information
I already implemented the changes in kit and adapter-node, but I'm waiting for the big update until doing the PR.
The text was updated successfully, but these errors were encountered: