diff options
Diffstat (limited to '')
-rw-r--r-- | build/zip-examples.mjs (renamed from build/zip-examples.js) | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/build/zip-examples.js b/build/zip-examples.mjs index 7378c33..6b44d45 100644 --- a/build/zip-examples.js +++ b/build/zip-examples.mjs @@ -7,12 +7,15 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -'use strict' +import fs from 'node:fs/promises' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import sh from 'shelljs' -const path = require('node:path') -const sh = require('shelljs') +const __dirname = path.dirname(fileURLToPath(import.meta.url)) -const pkg = require('../package.json') +const pkgJson = path.join(__dirname, '../package.json') +const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8')) const versionShort = pkg.config.version_short const distFolder = `bootstrap-${pkg.version}-examples` |