Skip to content

Support additional asset types #3

@thedodd

Description

@thedodd

Currently, trunk ships with a built-in scss/sass compiler (https://github.com/compass-rs/sass-rs). We definitely need to add support for additional asset types.

  • scss/sass (baked-in).
  • for now, images and such will need to be copied over directly, until we can do source transformation or some other pattern to update references throughout WASM (need to look into this a bit).
  • Plain CSS. For now, just copy & write to dist with hash.
    • probably need to do some CSS processing / handling of imports. For local CSS imports, just concatenate.
    • perhaps using something like <link data-trunk rel="css-components"/> any CSS found in the source tree will be concatenated & bundled, which would enable a nice zero-config "component styles" pattern. Users would be able to just create a CSS file right next to their Rust components, and Trunk will automatically process & bundle it.
  • setup glob resolution. Globs will just generate an individual asset per matched file. Probably just use globset.
  • LESS
  • postcss
  • stylus

There are probably plenty of other asset types the community will want to support. Let's talk about them here, and then create specific issues for each asset type when we are ready to build the plugin/pipeline system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    assetsBuild pipelines for specific asset types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions