中英文切换
This commit is contained in:
28
tmp_orb.cjs
Normal file
28
tmp_orb.cjs
Normal file
@@ -0,0 +1,28 @@
|
||||
const esbuild = require('esbuild');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
(async () => {
|
||||
const files = [
|
||||
'components/SystemSetting/BasicSettings.tsx',
|
||||
'components/SystemSetting/SerialNumGenerate.jsx',
|
||||
'components/SystemSetting/DroneManagement.tsx',
|
||||
'components/SystemSetting/SmartDeviceManagement.tsx',
|
||||
'components/SystemSetting/AlarmSettingsManagement.tsx',
|
||||
'components/SystemSetting/LogManagement.tsx',
|
||||
'components/SystemSetting/OnlineUser.tsx',
|
||||
'components/SystemSetting/VideoManagement.tsx',
|
||||
'components/SystemSetting/WorkOrderSettingsManagement.tsx'
|
||||
];
|
||||
for (const f of files) {
|
||||
const s = fs.readFileSync('src/' + f, 'utf8');
|
||||
const ext = path.extname(f);
|
||||
const loader = ext === '.tsx' ? 'tsx' : ext === '.ts' ? 'ts' : ext === '.jsx' ? 'jsx' : 'js';
|
||||
try {
|
||||
await esbuild.transform(s, { loader, target: 'es2020' });
|
||||
console.log('ORIG OK ' + f);
|
||||
} catch (e) {
|
||||
console.log('ORIG FAIL ' + f + ' :: ' + String(e.message).split('\n').slice(0, 4).join(' | '));
|
||||
}
|
||||
}
|
||||
console.log('DONE');
|
||||
})();
|
||||
Reference in New Issue
Block a user