Run build script via tools/make-nodejs.sh (#3808)

This commit is contained in:
Manish Jethani 2021-08-10 05:32:58 +05:30 committed by GitHub
parent 76abd04898
commit ab9f5ae100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -5,7 +5,7 @@
"type": "module",
"main": "index.js",
"scripts": {
"install": "node install.js",
"build": "node build.js",
"test": "node test.js"
},
"repository": {

View File

@ -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