build.js 396 B

12345678910111213141516
  1. module.exports = {
  2. main: 'index.js',
  3. platform: ['uni-app'],
  4. handler (file, platform) {
  5. if (platform === 'uni-app') {
  6. // 添加 img-cache 属性
  7. if (file.path.includes('mp-html.vue')) {
  8. file.contents = Buffer.from(
  9. file.contents
  10. .toString()
  11. .replace(/props\s*:\s*{/, 'props: {\n ImgCache: Boolean,')
  12. )
  13. }
  14. }
  15. }
  16. }