|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
15 | | -'use strict'; |
16 | | - |
17 | | - |
18 | 15 | // This script takes care of: |
19 | 16 | // - The build process for the whole UI and the chrome extension. |
20 | 17 | // - The HTTP dev-server with live-reload capabilities. |
|
65 | 62 | // +----------------------+ | +----------+ +--------------------+| |
66 | 63 | // +------------------------------------------------+ |
67 | 64 |
|
68 | | -const argparse = require('argparse'); |
69 | | -const childProcess = require('child_process'); |
70 | | -const crypto = require('crypto'); |
71 | | -const fs = require('fs'); |
72 | | -const http = require('http'); |
73 | | -const path = require('path'); |
74 | | -const zlib = require('zlib'); |
| 65 | +import argparse from 'argparse'; |
| 66 | +import childProcess from 'node:child_process'; |
| 67 | +import crypto from 'node:crypto'; |
| 68 | +import fs from 'node:fs'; |
| 69 | +import http from 'node:http'; |
| 70 | +import path from 'node:path'; |
| 71 | +import zlib from 'node:zlib'; |
| 72 | +import {fileURLToPath} from 'node:url'; |
| 73 | + |
75 | 74 | const pjoin = path.join; |
| 75 | +const __filename = fileURLToPath(import.meta.url); |
| 76 | +const __dirname = path.dirname(__filename); |
76 | 77 |
|
77 | 78 | const ROOT_DIR = path.dirname(__dirname); // The repo root. |
78 | 79 | const VERSION_SCRIPT = pjoin(ROOT_DIR, 'tools/write_version_header.py'); |
@@ -1213,7 +1214,7 @@ function prepareBuildLock() { |
1213 | 1214 | running = false; |
1214 | 1215 | } |
1215 | 1216 | if (running) { |
1216 | | - console.error(`Error: a build.js instance is already running (${cfg.lockFile} PID=${oldPid}).`); |
| 1217 | + console.error(`Error: a build.mjs instance is already running (${cfg.lockFile} PID=${oldPid}).`); |
1217 | 1218 | console.error('Hint: use --no-build (-n) to skip the build and avoid the lock.'); |
1218 | 1219 | process.exit(1); |
1219 | 1220 | } else { |
|
0 commit comments