WXT Layers

Nuxt-like layers functionality for WXT browser extensions

Overview

WXT Layers lets you to organise your WXT extension into self-contained modules:

+- src                   <-- core extension logic
+- layers
    +- some-feature      <-- isolated feature
    +- some-service      <-- isolated service

Layers can contain any combination of entrypoints, composables, public files, assets, etc.:

+- src                   <-- core extension logic
|   +- composables
|   +- entrypoints
|   +- public
|   +- utils
|
+- layers
    +- some-feature      <-- isolated feature
    |   +- entrypoints
    |   +- public
    |
    +- some-service      <-- isolated service
       +- composables
       +- index.ts

This approach is ideal for large projects where you need cleaner code organization and feature isolation, making your extension more maintainable and modular.

So...

I hope you found this post interesting or useful.

If you want to engage further, follow me on Twitter, Bluesky, or drop a comment or reaction below.

Either way, thanks for reading!