mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
feat: добавить серверную генерацию спрайтов
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
import { compileSpriteContent } from '../../compiler.js'
|
||||
import { createCompiledSpriteArtifact } from '../../core/compiled-artifact.js'
|
||||
import { resolveCompiledSpriteArtifact } from '../../core/resolve-compiled-artifact.js'
|
||||
import type { ModeAdapter } from '../../core/mode-adapter.js'
|
||||
import { generateOutputFiles } from './output.js'
|
||||
|
||||
export const svelteWebpackAdapter: ModeAdapter<'svelte@webpack'> = {
|
||||
mode: 'svelte@webpack',
|
||||
async generate(context) {
|
||||
const bytes = await compileSpriteContent(
|
||||
context.prepared.folder,
|
||||
const artifact = await resolveCompiledSpriteArtifact(
|
||||
context.prepared,
|
||||
context.config.transform,
|
||||
{ rootViewBox: false },
|
||||
)
|
||||
const artifact = createCompiledSpriteArtifact(bytes, context.prepared.iconNames, 'stack')
|
||||
|
||||
return {
|
||||
files: generateOutputFiles(context.config, artifact),
|
||||
|
||||
Reference in New Issue
Block a user