Passing the Rollup output options through to Vite#1572
Passing the Rollup output options through to Vite#1572benmccann merged 13 commits intosveltejs:masterfrom jp-simons:master
Conversation
|
Actually, wouldn't it make sense to do the same change in |
|
Would it actually make more sense to fix this in a general way, making a simple |
|
Huh, that seems like a weird default on Vite's part. I'm sure there's a rationale I'm not aware of. I suspect we should be overriding that by default, regardless of whether we respect the user's configuration here. I think the general // svelte.config.js
export default {
vite: {
build: {
outDir: 'custom-out-dir'
}
}
};...we might print a loud warning saying something like
We might need some way to indicate that a property shouldn't be merged. For example while we want to merge plugins... plugins: [
...(user_config.plugins || []),
svelte({
extensions: config.extensions,
emitCss: !config.kit.amp
})
]...we don't want to respect the user's
Generally speaking it's very possible that some options make sense in one context but not in another. We sort of anticipated this by making const user_config = config.kit.vite();...which could in theory receive options... const user_config = config.kit.vite({ type: 'service-worker' });...but that's a bit of a digression and we probably don't need to worry about that right now. |
|
I think Vite just got that from the Rollup docs where they give "vendor chunk" as an example. But so added a I was just going to do objects and let everything else be atomic, but the way the For the error message, I started with |
|
Also not sure where the tests should go for deep_merge, I just put along side. |
|
And, this is a pretty significant change and somewhat of a regression risk. We can always just do that first commit instead, mixing it in surgically. |
|
So I was concerned about this recursive merge because it recurses down through objects that might not be "plain old JS objects" but may have stuff in closure, or rely on Might be more like: Happy to make this change if desired. Plugins are certain to be fine already, recursion stops at arrays so they never get deep cloned. |
|
@johnnysprinkles thanks for this! as a heads up, there's quite a few errors being thrown by |
|
Thanks for taking a look @benmccann, yep getting up to speed on the process here and fumbling through the jsdoc typing. I'll have an update later today addressing your comments and passing all the checks. (My "today" being US west coast time.) |
|
Oh, that's "The Hulk" from https://iterm2colorschemes.com/, one of my favorites. |
|
@johnnysprinkles it looks like this one will need to be rebased |
packages/kit/src/core/dev/index.js
Outdated
| } | ||
| }); | ||
|
|
||
| conflicts.forEach((conflict) => { |
There was a problem hiding this comment.
could we put the print_vite_config_conflicts method somewhere shared and use it here?
There was a problem hiding this comment.
Cool, how about a generic "print_config_conflicts" that might as well use the logger() I suppose. See update.
|
Cool, this is looking pretty good! It will still need to be rebased The other thing I was thinking is that |
|
|
A little messy but makes sense if you view the diff of all commits as a whole. |
|
And yeah, I agree about load_config => config, makes sense to me. |
|
thanks for all your work on this one! |
|
Thanks for the review! I’m on a road trip from Seattle to Palm Springs and
did bring my laptop for more revisions but also cool to just get it in
there.
…On Mon, Jun 14, 2021 at 8:42 AM Ben McCann ***@***.***> wrote:
thanks for all your work on this one!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1572 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHYF4WVWEAJGEZ7XS3WJS43TSYPPDANCNFSM45VJUBUA>
.
|




This allows us to have more control of the rollup chunking when doing a production build. In particular, it allows us to specify
manualChunksso we can decide what goes in the vendor chunk, or to not have a vendor chunk at all and simply have large page-specific bundles.vite.build()does occur in three places in that file, I only updated in the one place, and verified it took effect when doing an "npm run build". Not sure if I should also update in the other places.Fixes #1571
Before submitting the PR, please make sure you do the following
Tests
pnpm testand lint the project withpnpm lintChangesets
pnpx changesetand following the prompts