Skip to content

Commit

Permalink
feat(packages/sui-bundler): update api
Browse files Browse the repository at this point in the history
  • Loading branch information
andresz1 committed Oct 18, 2024
1 parent 5da6feb commit e25b96e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
32 changes: 28 additions & 4 deletions packages/sui-bundler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,36 @@ Generate SVG spritemaps by using [svg-spritemap-webpack-plugin](https://github.c
"sui-bundler": {
"spritemaps": [
{
"path": "icons/src/fotocasa/**/*.svg",
"name": "fotocasa"
"path": ["icons/src/fotocasa/**/*.svg"],
"options": {
"output": {
"filename": "fotocasa.[contenthash].svg",
"chunk": {
"name": "fotocasa"
}
},
"sprite": {
"generate": {
"title": false
}
}
}
},
{
"path": "icons/src/habitaclia/**/*.svg",
"name": "habitaclia"
"path": ["icons/src/habitaclia/**/*.svg"],
"options": {
"output": {
"filename": "habitaclia.[contenthash].svg",
"chunk": {
"name": "habitaclia"
}
},
"sprite": {
"generate": {
"title": false
}
}
}
}
]
}
Expand Down
16 changes: 2 additions & 14 deletions packages/sui-bundler/shared/svg-spritemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,8 @@ const {config} = require('./config.js')
const createSVGSpritemapPlugin = () => {
const {spritemaps = []} = config

return spritemaps.map(({path, name}) => {
return new SVGSpritemapPlugin([path], {
output: {
filename: `${name}.[contenthash].svg`,
chunk: {
name
}
},
sprite: {
generate: {
title: false
}
}
})
return spritemaps.map(({path, options = {}}) => {
return new SVGSpritemapPlugin(path, options)
})
}

Expand Down

0 comments on commit e25b96e

Please sign in to comment.