Changes made

This commit is contained in:
monalisamsteccentric 2023-05-19 22:45:52 +05:30
parent 31c5a06b93
commit 1261b5f3d6
2 changed files with 1 additions and 33 deletions

View file

@ -27,8 +27,7 @@
"build": "concurrently \"yarn run build:main\" \"yarn run build:renderer\"", "build": "concurrently \"yarn run build:main\" \"yarn run build:renderer\"",
"build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts", "build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts",
"build:renderer": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.prod.ts", "build:renderer": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.prod.ts",
"postinstall": "yarn rimraf --glob node_modules/browser-sync/dist/**/*.map && yarn replace '\"network-throttle\".*' '' node_modules/browser-sync-ui/lib/UI.js && ts-node .erb/scripts/check-native-dep.js && replace-in-file '/// <reference types=\"howler\" />' \"import { Howl } from 'howler';\" node_modules/use-sound/dist/types.d.ts && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts", "postinstall": "yarn rimraf --glob node_modules/browser-sync/dist/**/*.map && ts-node .erb/scripts/check-native-dep.js && ts-node postinstall.ts && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
"postinstall": "ts-node postinstall.ts",
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx", "lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
"package": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build --publish never", "package": "ts-node ./.erb/scripts/clean.js dist && yarn run build && electron-builder build --publish never",
"prepare": "cd .. && husky install desktop-app/.husky && chmod a+x desktop-app/.husky/pre-commit", "prepare": "cd .. && husky install desktop-app/.husky && chmod a+x desktop-app/.husky/pre-commit",

View file

@ -1,5 +1,4 @@
import { replaceInFile } from 'replace-in-file'; import { replaceInFile } from 'replace-in-file';
import { execSync } from 'child_process';
async function performReplacements() { async function performReplacements() {
const replaceOptions = { const replaceOptions = {
@ -25,38 +24,8 @@ async function performReplacements() {
} }
} }
function runCheckNativeDepScript() {
try {
execSync('ts-node .erb/scripts/check-native-dep.js', { stdio: 'inherit' });
} catch (error) {
console.error('Error occurred during check-native-dep script:', error);
}
}
function installAppDeps() {
try {
execSync('electron-builder install-app-deps', { stdio: 'inherit' });
} catch (error) {
console.error('Error occurred during install-app-deps:', error);
}
}
function runWebpack() {
try {
execSync(
'cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts',
{ stdio: 'inherit' }
);
} catch (error) {
console.error('Error occurred during webpack:', error);
}
}
async function performPostInstall() { async function performPostInstall() {
await performReplacements(); await performReplacements();
runCheckNativeDepScript();
installAppDeps();
runWebpack();
} }
performPostInstall(); performPostInstall();