mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 01:38:21 +08:00
AlasGG
This commit is contained in:
18
webapp/scripts/update-electron-vendors.mjs
Normal file
18
webapp/scripts/update-electron-vendors.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* This script should be run in electron context
|
||||
* @example
|
||||
* ELECTRON_RUN_AS_NODE=1 electron scripts/update-electron-vendors.mjs
|
||||
*/
|
||||
|
||||
import {writeFileSync} from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const electronRelease = process.versions;
|
||||
|
||||
const node = electronRelease.node.split('.')[0];
|
||||
const chrome = electronRelease.v8.split('.').splice(0, 2).join('');
|
||||
|
||||
const browserslistrcPath = path.resolve(process.cwd(), '.browserslistrc');
|
||||
|
||||
writeFileSync('./.electron-vendors.cache.json', JSON.stringify({chrome, node}));
|
||||
writeFileSync(browserslistrcPath, `Chrome ${chrome}`, 'utf8');
|
||||
Reference in New Issue
Block a user