|
1 | | -const { exec } = require('child_process') |
| 1 | +const { exec } = require('child_process'); |
2 | 2 |
|
3 | 3 | const files = [ |
4 | 4 | 'services/notification/Notification.js', |
@@ -33,33 +33,33 @@ const files = [ |
33 | 33 | 'components/timepicker/TimePicker.vue', |
34 | 34 | 'components/tooltip/Tooltip.vue', |
35 | 35 | 'components/typeahead/Typeahead.vue', |
36 | | -] |
| 36 | +]; |
37 | 37 |
|
38 | 38 | function e(command, options) { |
39 | 39 | return new Promise((resolve, reject) => { |
40 | 40 | exec(command, options, (error, stdout, stderr) => { |
41 | 41 | if (error) { |
42 | | - console.error(`exec error: ${error}`) |
43 | | - reject(error) |
44 | | - process.exit(1) |
| 42 | + console.error(`exec error: ${error}`); |
| 43 | + reject(error); |
| 44 | + process.exit(1); |
45 | 45 | } |
46 | | - console.log(`stdout: ${stdout}`) |
47 | | - console.error(`stderr: ${stderr}`) |
48 | | - resolve() |
49 | | - }) |
50 | | - }) |
| 46 | + console.log(`stdout: ${stdout}`); |
| 47 | + console.error(`stderr: ${stderr}`); |
| 48 | + resolve(); |
| 49 | + }); |
| 50 | + }); |
51 | 51 | } |
52 | 52 |
|
53 | | -;(async function () { |
| 53 | +(async function () { |
54 | 54 | for (const file of files) { |
55 | | - const prefix = file.startsWith('directives') ? 'v_' : '' |
| 55 | + const prefix = file.startsWith('directives') ? 'v_' : ''; |
56 | 56 |
|
57 | 57 | await e('npx vite build -c build/vite.config.js', { |
58 | 58 | env: { |
59 | 59 | ...process.env, |
60 | 60 | UIV_ENTRY: file, |
61 | 61 | UIV_FILENAME: `${prefix + file.split('/').pop().split('.')[0]}.js`, |
62 | 62 | }, |
63 | | - }) |
| 63 | + }); |
64 | 64 | } |
65 | | -})() |
| 65 | +})(); |
0 commit comments