From 8e9d9e9a1185aca1f541c42a8169e6ed80ca91fb Mon Sep 17 00:00:00 2001 From: vexorian Date: Tue, 28 Jul 2020 15:38:47 -0400 Subject: [PATCH] nexe instead of pkg --- Dockerfile | 2 +- make_dist.sh | 20 ++++++++++++++++++++ package.json | 18 +++--------------- 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 make_dist.sh diff --git a/Dockerfile b/Dockerfile index cb88826..3475f3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ RUN apk add --update \ WORKDIR /home/node/app COPY package*.json ./ RUN npm install -RUN npm install -g browserify +RUN npm install -g browserify nexe EXPOSE 8000 CMD [ "npm", "start"] COPY . . diff --git a/make_dist.sh b/make_dist.sh new file mode 100644 index 0000000..9b7e33a --- /dev/null +++ b/make_dist.sh @@ -0,0 +1,20 @@ +#!/bin/sh +WIN64=pseudotv-win-x64.exe +WIN32=pseudotv-win-x86.exe +MACOSX=pseudotv-macos-x64 +LINUX64=pseudotv-linux-x64 + +npm run build +npm run compile +cp -R ./web ./dist/web +cp -R ./resources ./dist/ +cd dist +nexe -r "./**/*" -t windows-x64-12.18.2 --output $WIN64 +nexe -r "./**/*" -t linux-x64-12.16.2 --output $LINUX64 +nexe -r "./**/*" -t mac-x64-12.18.2 --output $MACOSX +nexe -r "./**/*" -t windows-x86-12.18.2 --output $WIN32 + +echo dist/$WIN64 +echo dist/$LINUX64 +echo dist/$MACOSX +echo dist/WIN32 diff --git a/package.json b/package.json index 2f79332..dbff88e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dev-client": "watchify ./web/app.js -o ./web/public/bundle.js", "dev-server": "nodemon index.js --ignore ./web/ --ignore ./db/ --ignore ./xmltv.xml", "compile": "babel index.js -d dist && babel src -d dist/src", - "package": "copyfiles ./web/public/**/* ./dist && copyfiles ./resources/**/* ./dist && pkg . --out-path bin", + "package": "sh ./make_dist.sh", "clean": "del-cli --force ./bin ./dist ./.pseudotv ./web/public/bundle.js" }, "author": "Dan Ferguson", @@ -28,18 +28,6 @@ "xml-writer": "^1.7.0" }, "bin": "dist/index.js", - "pkg": { - "assets": [ - "dist/web/public/**/*", - "dist/resources/**/*" - ], - "targets": [ - "x64", - "linux", - "macos", - "windows" - ] - }, "devDependencies": { "@babel/cli": "^7.8.4", "@babel/core": "^7.9.0", @@ -49,8 +37,8 @@ "copyfiles": "^2.2.0", "del-cli": "^3.0.0", "nodemon": "^2.0.3", - "pkg": "^4.4.7", - "watchify": "^3.11.1" + "watchify": "^3.11.1", + "nexe" : "^3.3.7" }, "babel": { "plugins": [