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. // Use loadJSON() because require() would keep the string in memory.
serialized = loadJSON('build/publicsuffixlist.json'); serialized = loadJSON('build/publicsuffixlist.json');
} catch (error) { } catch (error) {
if ( process.env.npm_lifecycle_event !== 'install' ) { if ( process.env.npm_lifecycle_event !== 'build' ) {
// This should never happen except during package installation. // This should never happen except during package building.
console.error(error); console.error(error);
} }
} }

View File

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

View File

@ -57,6 +57,10 @@ cp platform/nodejs/*.json $DES/
cp platform/nodejs/README.md $DES/ cp platform/nodejs/README.md $DES/
cp LICENSE.txt $DES/ cp LICENSE.txt $DES/
cd $DES
npm run build
cd -
if [ "$1" = all ]; then if [ "$1" = all ]; then
echo "*** uBlock0.nodejs: Creating plain package..." echo "*** uBlock0.nodejs: Creating plain package..."
pushd $(dirname $DES/) > /dev/null pushd $(dirname $DES/) > /dev/null