diff --git a/platform/nodejs/install.js b/platform/nodejs/build.js similarity index 100% rename from platform/nodejs/install.js rename to platform/nodejs/build.js diff --git a/platform/nodejs/index.js b/platform/nodejs/index.js index 308a1bb22..3267f5507 100644 --- a/platform/nodejs/index.js +++ b/platform/nodejs/index.js @@ -85,8 +85,8 @@ function pslInit(raw) { // Use loadJSON() because require() would keep the string in memory. serialized = loadJSON('build/publicsuffixlist.json'); } catch (error) { - if ( process.env.npm_lifecycle_event !== 'install' ) { - // This should never happen except during package installation. + if ( process.env.npm_lifecycle_event !== 'build' ) { + // This should never happen except during package building. console.error(error); } } diff --git a/platform/nodejs/package.json b/platform/nodejs/package.json index 7d006a256..53dba8add 100644 --- a/platform/nodejs/package.json +++ b/platform/nodejs/package.json @@ -5,7 +5,7 @@ "type": "module", "main": "index.js", "scripts": { - "install": "node install.js", + "build": "node build.js", "test": "node test.js" }, "repository": { diff --git a/tools/make-nodejs.sh b/tools/make-nodejs.sh index 37d6d8247..0455d9ae1 100755 --- a/tools/make-nodejs.sh +++ b/tools/make-nodejs.sh @@ -57,6 +57,10 @@ cp platform/nodejs/*.json $DES/ cp platform/nodejs/README.md $DES/ cp LICENSE.txt $DES/ +cd $DES +npm run build +cd - + if [ "$1" = all ]; then echo "*** uBlock0.nodejs: Creating plain package..." pushd $(dirname $DES/) > /dev/null