diff options
| author | Billy Biggs <[email protected]> | 2025-06-14 22:30:00 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-15 05:30:00 +0000 |
| commit | e717c51aa1e46d1a1aabdb7e770c248b93e437a6 (patch) | |
| tree | 2a1609f0e09a01688b42490f310ea40174ac6599 /scripts/copy_bundle_assets.js | |
| parent | 53753f0455458dda4055f42ca9caf3aa898bc3c4 (diff) | |
Avoid import.meta.dirname to be backwards compatible to Node.js 18+ (#1058)
Diffstat (limited to 'scripts/copy_bundle_assets.js')
| -rw-r--r-- | scripts/copy_bundle_assets.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/copy_bundle_assets.js b/scripts/copy_bundle_assets.js index cb1ac197..e37e1700 100644 --- a/scripts/copy_bundle_assets.js +++ b/scripts/copy_bundle_assets.js @@ -18,10 +18,12 @@ // limitations under the License. import { copyFileSync, existsSync, mkdirSync } from 'fs'; -import { join, basename } from 'path'; +import { dirname, join, basename } from 'path'; +import { fileURLToPath } from 'url'; import { glob } from 'glob'; -const root = join(import.meta.dirname, '..'); +const __dirname = dirname(fileURLToPath(import.meta.url)); +const root = join(__dirname, '..'); const bundleDir = join(root, 'bundle'); // Create the bundle directory if it doesn't exist |
