{"repo":"bluwy/svelte-preprocess-import-assets","free":true,"listed":false,"github":"https://github.com/bluwy/svelte-preprocess-import-assets","clone":"git clone https://github.com/bluwy/svelte-preprocess-import-assets.git","description":"Import assets directly in your markup","language":"JavaScript","stars":102,"topics":["svelte","preprocess","assets"],"license":"MIT","category":"ui-components","readme_excerpt":"svelte-preprocess-import-assets Import assets directly in the markup. Supports Svelte 3, 4, and 5. NOTE: Svelte 5 support is experimental and may break between versions. Convert this: Into this: Usage Install with your package manager: Include the preprocessor in your bundler's Svelte plugin preprocess option: API The importAssets() function receives an optional options object for its first parameter. The object may contain these properties: sources - Type: AssetSource[] ((defaultSources: AssetSource[]) = AssetSource[]) - Default: See DEFAULT SOURCES in src/constants.js These are the sources to look for when scanning for imports. You can provide an entirely different list of sources, or declare a function to access the default sources and augment it. The supported tags and attributes are based on html-loader (except icon-uri ). Component name as tag is also supported. importPrefix - Type: string - Default: ASSET The string to be prefixed for asset import names, e.g. ASSET 0 and ASSET 1 . http - Type: boolean - Default: false Whether a URL with http/https protocol should be converted to an import. urlFilter - Type: (url: string) = boolean Whether a URL should be converted into an import. Recipes Ignore an element Attributions - svelte-assets-preprocessor: Initial motivation to reduce dependencies. Sponsors License MIT","default_branch":null,"files":null,"tree":[],"storefront":"/r/bluwy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bluwy/svelte-preprocess-import-assets/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}