You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we now use globs for content sources (similar to Tailwind CSS v3), the environment config merging strategy falls short in some cases. For example, consider the following setup:
Normally, when we run maizzle build sendgrid we'd expect it to just build our Sendgrid templates.
However, if src/templates also contains some assets folders, like say images, then because of the config merging the src/images folder will also be considered a templates source.
That would work, as in the folder would just get copied over and the build would succeed.
However, we'd get a build output folder with this structure:
build_sendgrid
|-- sendgrid
|-- images
When in fact we just want this:
build_sendgrid
|-- sendgrid
Solution
To fix this we could try to not merge the build.content keys, effectively overriding the one you have in config.js.
This would be a breaking change if you're relying on the merging strategy when building for production, i.e. you need templates defined in build.content from config.js and are just adding sources to it - in this case you'd need to always define all of your content sources in each config file.
Note: I ran into this a few times while working on real life projects with v5 beta, but I might be biased in the way I use it, so leaving this open for now - input is appreciated 👍
The text was updated successfully, but these errors were encountered:
Because we now use globs for content sources (similar to Tailwind CSS v3), the environment config merging strategy falls short in some cases. For example, consider the following setup:
config.js
config.sendgrid.js
Normally, when we run
maizzle build sendgrid
we'd expect it to just build our Sendgrid templates.However, if
src/templates
also contains some assets folders, like sayimages
, then because of the config merging thesrc/images
folder will also be considered a templates source.That would work, as in the folder would just get copied over and the build would succeed.
However, we'd get a build output folder with this structure:
When in fact we just want this:
Solution
To fix this we could try to not merge the
build.content
keys, effectively overriding the one you have inconfig.js
.This would be a breaking change if you're relying on the merging strategy when building for production, i.e. you need templates defined in
build.content
fromconfig.js
and are just adding sources to it - in this case you'd need to always define all of your content sources in each config file.Note: I ran into this a few times while working on real life projects with v5 beta, but I might be biased in the way I use it, so leaving this open for now - input is appreciated 👍
The text was updated successfully, but these errors were encountered: