Skip to content

Commit baa43a3

Browse files
authored
Merge pull request #616 from marp-team/fix-standalone-build
Fix packaging script for standalone binaries
2 parents a438d1e + fbfc94b commit baa43a3

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Fixed
6+
7+
- Fix packaging script for standalone binaries ([#616](https://github.com/marp-team/marp-cli/pull/616))
8+
59
## v4.0.1 - 2024-10-31
610

711
### Removed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"prepack": "npm-run-all --parallel check:* lint:* test:coverage --parallel build types",
6060
"preversion": "run-p check:* lint:* test:coverage",
6161
"standalone": "node -e \"fs.rmSync('bin',{recursive:true,force:true})\" && pkg -C gzip --out-path ./bin .",
62-
"standalone:pack": "node ./scripts/pack.js",
62+
"standalone:pack": "node ./scripts/pack.mjs",
6363
"test": "jest",
6464
"test:coverage": "jest --coverage",
6565
"types": "node -e \"fs.rmSync('types',{recursive:true,force:true})\" && tsc --declaration --emitDeclarationOnly --outDir types",

scripts/pack.js renamed to scripts/pack.mjs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
/* Pack built standalone binaries for release. */
22

3-
const fs = require('node:fs')
4-
const path = require('node:path')
5-
const zlib = require('node:zlib')
6-
const tar = require('tar-stream')
7-
const ZipStream = require('zip-stream')
3+
import fs from 'node:fs'
4+
import { createRequire } from 'node:module'
5+
import path from 'node:path'
6+
import { fileURLToPath } from 'node:url'
7+
import zlib from 'node:zlib'
8+
import tar from 'tar-stream'
9+
import ZipStream from 'zip-stream'
10+
11+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
12+
const require = createRequire(import.meta.url)
813
const { version } = require('../package.json')
914

1015
const bin = path.resolve(__dirname, '../bin')

0 commit comments

Comments
 (0)