diff --git a/.github/workflows/insiders-build.yaml b/.github/workflows/insiders-build.yaml index 64ea4165..6c63af7f 100644 --- a/.github/workflows/insiders-build.yaml +++ b/.github/workflows/insiders-build.yaml @@ -12,8 +12,8 @@ jobs: include: - os: win-code-sign build: | - ./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify - pkg --output "./${env:DIST_FILE_NAME}.exe" -t node18-win-x64 ./build.cjs --config package.json --compress GZip + ./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify --inject:./src/lib/import-meta-url.js --define:import.meta.url=import_meta_url + pkg --output "./${env:DIST_FILE_NAME}.exe" -t node18-win-x64 ./build.cjs --config package.json --options no-deprecation --compress GZip dir @@ -85,8 +85,8 @@ jobs: artifact_insider: butler-sos--win-x64--${{ github.sha }}.zip - os: mac-build1 build: | - ./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify - pkg --output "./${DIST_FILE_NAME}" -t node18-macos-x64 ./build.cjs --config package.json --compress GZip + ./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify --inject:./src/lib/import-meta-url.js --define:import.meta.url=import_meta_url + pkg --output "./${DIST_FILE_NAME}" -t node18-macos-x64 ./build.cjs --config package.json --options no-deprecation --compress GZip chmod +x "${DIST_FILE_NAME}" security delete-keychain build.keychain || true @@ -147,8 +147,8 @@ jobs: artifact_insider: butler-sos--macos-x64--${{ github.sha }}.zip - os: ubuntu-latest build: | - ./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify - pkg --output "./${DIST_FILE_NAME}" -t node18-linux-x64 ./build.cjs --config package.json --compress GZip + ./node_modules/.bin/esbuild src/bundle.js --bundle --external:axios --external:xdg-open --external:enigma.js --outfile=build.cjs --format=cjs --platform=node --target=node18 --minify --inject:./src/lib/import-meta-url.js --define:import.meta.url=import_meta_url + pkg --output "./${DIST_FILE_NAME}" -t node18-linux-x64 ./build.cjs --config package.json --options no-deprecation --compress GZip chmod +x ${DIST_FILE_NAME} diff --git a/src/lib/import-meta-url.js b/src/lib/import-meta-url.js new file mode 100644 index 00000000..2e5f8730 --- /dev/null +++ b/src/lib/import-meta-url.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line import/prefer-default-export, import/no-mutable-exports, no-var, camelcase, import/no-commonjs, global-require +export var import_meta_url = require('url').pathToFileURL(__filename);