mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 14:54:12 +00:00
31 lines
805 B
TypeScript
31 lines
805 B
TypeScript
import { replaceInFile } from 'replace-in-file';
|
|
|
|
async function performReplacements() {
|
|
const replaceOptions = {
|
|
files: 'node_modules/browser-sync-ui/lib/UI.js',
|
|
from: /"network-throttle".*/,
|
|
to: '',
|
|
};
|
|
|
|
const howlerOptions = {
|
|
files: 'node_modules/use-sound/dist/types.d.ts',
|
|
from: '/// <reference types="howler" />',
|
|
to: 'import { Howl } from "howler";',
|
|
};
|
|
|
|
try {
|
|
await replaceInFile(replaceOptions);
|
|
console.log('Replacement in UI.js completed successfully.');
|
|
|
|
await replaceInFile(howlerOptions);
|
|
console.log('Replacement in types.d.ts completed successfully.');
|
|
} catch (error) {
|
|
console.error('Error occurred during replacements:', error);
|
|
}
|
|
}
|
|
|
|
async function performPostInstall() {
|
|
await performReplacements();
|
|
}
|
|
|
|
performPostInstall();
|