build.js 469 B

1234567891011121314
  1. module.exports = {
  2. import: 'katex.css',
  3. handler (file) {
  4. if (file.isBuffer()) {
  5. let content = file.contents.toString()
  6. if (file.basename === 'node.wxml') {
  7. content = content.replace(/(n.?)\.name==='a'\|\|/g, "$1.name==='a'||$1.l||")
  8. } else if (file.basename === 'node.vue') {
  9. content = content.replace(/!handler.isInline\((.*?)\)/, '(n.l||!handler.isInline($1))')
  10. }
  11. file.contents = Buffer.from(content)
  12. }
  13. }
  14. }