Commit c143bd7c by 李伟康

fix(build): 修复图标精灵样式生成问题

- 注释掉不必要的 .join('\n') 操作
- 移除返回语句中的多余换行符拼接
- 确保样式字符串正确连接而不引入额外空白
1 parent b12d5b31
...@@ -13,7 +13,7 @@ const spritesmithFunction = data => { ...@@ -13,7 +13,7 @@ const spritesmithFunction = data => {
;((width = toRpx(width)), (height = toRpx(height)), (offset_x = toRpx(offset_x)), (offset_y = toRpx(offset_y))) ;((width = toRpx(width)), (height = toRpx(height)), (offset_x = toRpx(offset_x)), (offset_y = toRpx(offset_y)))
return `.icon-${name} { width: ${width}; height: ${height};background-position: ${offset_x} ${offset_y};}` return `.icon-${name} { width: ${width}; height: ${height};background-position: ${offset_x} ${offset_y};}`
}) })
.join('\n') // .join('\n')
// let shared = `.sprite-icon { background-image: url(${ // let shared = `.sprite-icon { background-image: url(${
// data.sprites[0].image // data.sprites[0].image
// });background-size: ${spritesheet.width / 2}rpx ${ // });background-size: ${spritesheet.width / 2}rpx ${
...@@ -27,7 +27,7 @@ const spritesmithFunction = data => { ...@@ -27,7 +27,7 @@ const spritesmithFunction = data => {
// }rpx; background-position: ${offset_x / 2}rpx ${offset_y / 2}rpx;}`; // }rpx; background-position: ${offset_x / 2}rpx ${offset_y / 2}rpx;}`;
// }) // })
// .join("\n"); // .join("\n");
return `${shared}\n${perSprite}` return `${shared}${perSprite}`
} }
const path = require('path') const path = require('path')
const { domain, djDomain, evaluationDomain, merchantDomain } = require('./env.js') const { domain, djDomain, evaluationDomain, merchantDomain } = require('./env.js')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!