Debian Codegraph @

pkg/lib/cockpit-remove-rhicons-plugin.js

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2
3 import fs from 'node:fs';
4
5 export const cockpitRemoveRHIconsPlugin = () => ({
6 name: 'cockpitRemoveRHIconsPlugin',
7 setup(build) {
8 build.onLoad({ filter: /-icon\.js$/ }, async ({ path }) => {
9 const contents = await fs.promises.readFile(path, 'utf-8');
10 return { contents: contents.replace(/rhUiIcon: {.*}/g, "undefined") };
11 });
12 }
13 });