Skip to content

Commit 28267cb

Browse files
committed
use a custom script to call Rollup
1 parent 7ec7d69 commit 28267cb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build:cjs": "tsc -p tsconfig.json",
1212
"build:es": "tsc -p tsconfig-esm.json",
1313
"postbuild": "run-s bundle",
14-
"bundle": "rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js",
14+
"bundle": "node ./rollup-script.js",
1515
"test": "run-s test:ava test:puppeteer:basic test:puppeteer:webpack",
1616
"test:ava": "cross-env TS_NODE_FILES=true ava",
1717
"test:puppeteer:basic": "puppet-run --plugin=mocha --bundle=./test/workers/:/workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts",

rollup-script.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const child_process = require('child_process');
2+
const path = require('path')
3+
4+
if (parseFloat(process.version.match(/^v(\d+\.\d+)/)[1]) < 10) {
5+
child_process.spawnSync(`node ${path.resolve('./node_modules/rollup-old/dist/bin/rollup')} -c -f umd --file=bundle/worker.js --name=threads -- dist-esm/worker/bundle-entry.js`, {stdio: 'inherit'})
6+
} else {
7+
child_process.spawnSync(`node ${path.resolve('./node_modules/rollup/dist/bin/rollup')} -c -f umd --file=bundle/worker.js --name=threads -- dist-esm/worker/bundle-entry.js`, {stdio: 'inherit'})
8+
}

0 commit comments

Comments
 (0)