fix: running on gitpod

This commit is contained in:
mochaaP 2022-06-21 15:07:22 +00:00
parent 6ebe817b47
commit 190642224d
3 changed files with 8 additions and 5 deletions

View File

@ -4,6 +4,8 @@ tasks:
- init: composer install
command: |
cp .env.example .env
mkdir public/app/
cp resources/assets/src/images/bg.webp resources/assets/src/images/favicon.ico public/app
touch storage/database.db
sed 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/' -i .env
sed 's/DB_DATABASE=blessingskin/DB_DATABASE=\/workspace\/blessing-skin-server\/storage\/database\.db/' -i .env

View File

@ -1,10 +1,8 @@
declare let __webpack_public_path__: string
declare const __blessing_public_path__: string
if (process.env.NODE_ENV === 'development') {
const url = new URL(blessing.base_url)
url.port = '8080'
url.pathname = '/app/'
__webpack_public_path__ = url.toString()
__webpack_public_path__ = __blessing_public_path__
} else {
const link = document.querySelector<HTMLLinkElement>('link#cdn-host')
const base = link?.href ?? blessing.base_url

View File

@ -123,6 +123,7 @@ export default function (env?: Env): webpack.Configuration[] {
version: {},
},
'process.platform': '"browser"',
__blessing_public_path__: JSON.stringify(htmlPublicPath),
}),
].concat(isDev ? [new webpack.HotModuleReplacementPlugin()] : []),
resolve: {
@ -151,7 +152,9 @@ export default function (env?: Env): webpack.Configuration[] {
hot: true,
hotOnly: true,
stats: 'errors-warnings',
allowedHosts: isGitpod ? ['localhost', '.gitpod.io'] : undefined,
allowedHosts: ['localhost'].concat(
isDev && isGitpod ? ['.gitpod.io'] : [],
),
},
stats: 'errors-warnings',
ignoreWarnings: [/size limit/i],