Skip to content

Commit

Permalink
fix: initialize transform asset urls correctly (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin authored Jul 18, 2024
1 parent 5b79b46 commit 493b93e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export default withPwa(defineConfig({
}, {
text: 'Vuetify Blueprints',
link: '/guide/vuetify-blueprints',
}, {
text: 'Transform Asset URLs',
link: '/guide/transform-asset-urls',
}, {
text: 'Globals',
link: '/guide/globals/',
Expand Down
10 changes: 10 additions & 0 deletions docs/guide/transform-asset-urls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Transform Asset URLs

The module configures the `transformAssetUrls` from [Vuetify Vite Plugin](https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#image-loading) to resolve relative asset URLs that are passed to Vuetify components such as `VImg` (e.g. `~/assets/img/some.png`).

You can also add custom entries to the `includeTransformAssetsUrls` module option, for example, to include external components, or you can disable the module option to exclude all entries.

The module will include the following normalizations for each entry in `includeTransformAssetsUrls` module option:
- add kebab and pascal case entries (if missing from the original)
- add kebab and camel case and bind (`:xxx`) attrs entries (if missing from original)
- excluded normalizations on original attrs entries containing `:` (for example `xlink:href`)
1 change: 1 addition & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default defineNuxtModule<VuetifyModuleOptions>({
},
moduleOptions: {
importComposables: true,
includeTransformAssetsUrls: true,
styles: true,
},
}),
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ export interface MOptions {
*
* @see https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin
* @see https://github.com/userquin/vuetify-nuxt-module/issues/78 and https://github.com/userquin/vuetify-nuxt-module/issues/74
*
* @default true
*/
styles?: true | 'none' | 'sass' | {
configFile: string
Expand Down

0 comments on commit 493b93e

Please sign in to comment.