From 2b363f15158cb6b548e9b647aadbefbc8554eb08 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Fri, 11 Aug 2023 04:21:41 +0300 Subject: [PATCH] include actual github repo when used on github repo --- lib/menus/pause_screen.js | 2 +- lib/menus/title_screen.js | 2 +- webpack.prod.js | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/menus/pause_screen.js b/lib/menus/pause_screen.js index a4fce77..01ef83d 100644 --- a/lib/menus/pause_screen.js +++ b/lib/menus/pause_screen.js @@ -57,7 +57,7 @@ class PauseScreen extends LitElement {
- openURL('https://github.com/PrismarineJS/prismarine-web-client')}> + openURL(process.env.GITHUB_URL)}> openURL('https://discord.gg/4Ucm684Fq3')}>
showModal(document.getElementById('options-screen'))}> diff --git a/lib/menus/title_screen.js b/lib/menus/title_screen.js index b95b2b7..e01d8eb 100644 --- a/lib/menus/title_screen.js +++ b/lib/menus/title_screen.js @@ -113,7 +113,7 @@ class TitleScreen extends LitElement { }}> showModal(document.getElementById('options-screen'))}> diff --git a/webpack.prod.js b/webpack.prod.js index 4f5f6c8..3b95ec0 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -8,6 +8,7 @@ const webpack = require('webpack') module.exports = merge(common, { mode: 'production', + devtool: 'source-map', plugins: [ new CleanWebpackPlugin(), new webpack.optimize.ModuleConcatenationPlugin(), @@ -19,5 +20,11 @@ module.exports = merge(common, { skipWaiting: true, include: ['index.html', 'manifest.json'] // not caching a lot as anyway this works only online }), - ] + new webpack.ProvidePlugin({ + // get from github actions or vercel env + GITHUB_URL: process.env.VERCEL_GIT_REPO_OWNER + ? `https://github.com/${process.env.VERCEL_GIT_REPO_OWNER}/${process.env.VERCEL_GIT_REPO_SLUG}` + : process.env.GITHUB_REPOSITORY + }) + ], })