Fix building and serving a dev bundle
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
1fc2eb8e9c
commit
52f37bb9fb
19
.drone.yml
19
.drone.yml
|
@ -78,7 +78,19 @@ steps:
|
|||
depends_on:
|
||||
- dependencies
|
||||
|
||||
- name: build
|
||||
# Building in dev mode to avoid the service worker for testing
|
||||
- name: build-dev
|
||||
image: node:16
|
||||
pull: true
|
||||
environment:
|
||||
YARN_CACHE_FOLDER: .cache/yarn/
|
||||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
||||
commands:
|
||||
- yarn build:dev
|
||||
depends_on:
|
||||
- dependencies
|
||||
|
||||
- name: build-prod
|
||||
image: node:16
|
||||
pull: true
|
||||
environment:
|
||||
|
@ -106,11 +118,12 @@ steps:
|
|||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
||||
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
|
||||
commands:
|
||||
- sed -i 's/localhost/api/g' index.html
|
||||
- yarn serve -l warn & npx wait-on http://localhost:5000
|
||||
- sed -i 's/localhost/api/g' dist-dev/index.html
|
||||
- yarn serve:dist-dev & npx wait-on http://localhost:8000
|
||||
- yarn test:frontend --browser chrome
|
||||
depends_on:
|
||||
- dependencies
|
||||
- build-dev
|
||||
|
||||
- name: upload-test-results
|
||||
image: plugins/s3:1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"baseUrl": "http://localhost:5000",
|
||||
"baseUrl": "http://localhost:8000",
|
||||
"env": {
|
||||
"API_URL": "http://localhost:3456/api/v1",
|
||||
"TEST_SECRET": "testingS3cr3et"
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vite",
|
||||
"serve:dist": "vite preview",
|
||||
"serve:dist-dev": "node scripts/serve-dist.js",
|
||||
"build": "vite build && rollup -c ./rollup.sw.js && workbox copyLibraries dist/",
|
||||
"build:dev": "vite build -m development --outDir dist-dev/ && workbox copyLibraries dist-dev/",
|
||||
"build:dev": "vite build -m development --outDir dist-dev/",
|
||||
"build:report": "vue-cli-service build --report",
|
||||
"lint": "vue-cli-service lint --ignore-pattern '*.test.*'",
|
||||
"cypress:open": "cypress open",
|
||||
|
|
|
@ -2,7 +2,7 @@ const path = require('path')
|
|||
const express = require('express')
|
||||
const app = express()
|
||||
|
||||
const p = path.join(__dirname, '..', 'dist')
|
||||
const p = path.join(__dirname, '..', 'dist-dev')
|
||||
const port = 8000
|
||||
|
||||
app.use(express.static(p))
|
||||
|
|
Reference in New Issue