Skip to content

Commit e25b96e

Browse files
committed
feat(packages/sui-bundler): update api
1 parent 5da6feb commit e25b96e

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

packages/sui-bundler/README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,36 @@ Generate SVG spritemaps by using [svg-spritemap-webpack-plugin](https://github.c
236236
"sui-bundler": {
237237
"spritemaps": [
238238
{
239-
"path": "icons/src/fotocasa/**/*.svg",
240-
"name": "fotocasa"
239+
"path": ["icons/src/fotocasa/**/*.svg"],
240+
"options": {
241+
"output": {
242+
"filename": "fotocasa.[contenthash].svg",
243+
"chunk": {
244+
"name": "fotocasa"
245+
}
246+
},
247+
"sprite": {
248+
"generate": {
249+
"title": false
250+
}
251+
}
252+
}
241253
},
242254
{
243-
"path": "icons/src/habitaclia/**/*.svg",
244-
"name": "habitaclia"
255+
"path": ["icons/src/habitaclia/**/*.svg"],
256+
"options": {
257+
"output": {
258+
"filename": "habitaclia.[contenthash].svg",
259+
"chunk": {
260+
"name": "habitaclia"
261+
}
262+
},
263+
"sprite": {
264+
"generate": {
265+
"title": false
266+
}
267+
}
268+
}
245269
}
246270
]
247271
}

packages/sui-bundler/shared/svg-spritemap.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,8 @@ const {config} = require('./config.js')
44
const createSVGSpritemapPlugin = () => {
55
const {spritemaps = []} = config
66

7-
return spritemaps.map(({path, name}) => {
8-
return new SVGSpritemapPlugin([path], {
9-
output: {
10-
filename: `${name}.[contenthash].svg`,
11-
chunk: {
12-
name
13-
}
14-
},
15-
sprite: {
16-
generate: {
17-
title: false
18-
}
19-
}
20-
})
7+
return spritemaps.map(({path, options = {}}) => {
8+
return new SVGSpritemapPlugin(path, options)
219
})
2210
}
2311

0 commit comments

Comments
 (0)