Skip to content

Conversation

kellymears
Copy link
Contributor

@kellymears kellymears commented Dec 30, 2021

ref: #897

Type of change

  • PATCH: bugfix

Dependencies added

  • none

Details

First a couple under-the-hood changes:

  • Experimental: adds barebones css modules support for *.module.css assets.
  • Prefers include over exclude for modules.
    • This makes it easier in a project config to override where modules are sourced from.
    • By default most modules are sourced from src. This does not include node_modules.
    • If someone needs to source something from node_modules (font-awesome, etc.) they can set bud to look for modules there with: bud.build.rule.js.setInclude(bud.path('project')). js can be replaced with any bud.build.rule registered to bud. by default that includes: js, css, image, font, json, yml, html, csv, xml, toml. see refactor(@roots/bud-build) build.rules api #891.
    • It is hugely expensive to look through all of node_modules when the majority of users won't be trying to compile things from it directly. Hence, our default. And now, a simpler way to override that default if needed.

Output paths

  • image assets now emitted to images/ instead of assets/images
  • svg assets now emitted to svg/ instead of assets/
  • font assets now emitted to fonts/ instead of assets/

for @roots/sage:

  • svg assets are emitted to images/, instead of the new default svg/

@kellymears
Copy link
Contributor Author

tests failing because:

  1. snapshots will need to be updated, and;
  2. the image minimizer integration test is still looking for the emitted test image in assets/

i'm not going to do either of those things. i'm just going to let @roots/sage handle this using an override, as mentioned.

@kellymears
Copy link
Contributor Author

I would like to see #891 merged before doing this. It concerns the API we're using to do this.

If there hasn't been any movement/feedback by later today I'm going to go ahead and merge it.

@github-actions github-actions bot added @roots/bud-framework @roots/sage dependencies Pull requests that update a dependency file test labels Dec 31, 2021
@kellymears kellymears modified the milestones: 5.0.1, 5.1.0 Dec 31, 2021
@kellymears kellymears marked this pull request as ready for review December 31, 2021 11:13
@kellymears
Copy link
Contributor Author

This is ready.

@kellymears kellymears merged commit 3b5ab98 into next Jan 1, 2022
@kellymears kellymears deleted the 897-asset-directive branch January 1, 2022 02:04
@kellymears kellymears mentioned this pull request Jan 4, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant