JavaScript generic ASN.1 parser (mirror)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 2.0.3 29 lines 1.1 kB view raw
1import fs from 'node:fs'; 2import { defineConfig } from 'vite'; 3import { viteSingleFile } from 'vite-plugin-singlefile'; 4import pluginDom from 'vite-plugin-dom'; 5import { DomUtils } from 'htmlparser2'; 6 7const removeNodes = [ 'theme-select', 'rowExamples' ]; 8 9export default defineConfig({ 10 plugins: [ 11 pluginDom({ 12 applyOnMode: true, // all modes 13 handler: node => { 14 if (removeNodes.includes(node.attribs.id)) 15 DomUtils.removeElement(node); 16 else if (node.name == 'link' && node.attribs.rel == 'icon') { 17 //node.attribs.href = 'data:image/svg+xml,' + encodeURI(fs.readFileSync('favicon.svg', 'ascii').replace(/^([^<]+|<[^s]|<s[^v]|<sv[^g])+/, '').trim()); 18 node.attribs.href = 'data:image/svg+xml;base64,' + btoa(fs.readFileSync('favicon.svg', 'ascii').replace(/^([^<]+|<[^s]|<s[^v]|<sv[^g])+/, '').trim()); 19 console.log(node.attribs.href); 20 } 21 }, 22 }), 23 viteSingleFile(), 24 ], 25 build: { 26 minify: false, 27 cssMinify: false, 28 }, 29});