Closed rossity closed 6 years ago
Would it be as simple as moving this line into the finalize promise?
Hi,
Good way: build > copy dist folder somewhere > serve from there Bad way: build (so dist folder gets generated) > delete dist > ending up with no dist folder :)
PS: the dist/* folders can be standalone by themselves.
@rstoenescu thanks for the response! I didn't mean delete the dist folder, I just meant is it possible to move the artifacts.clean(outputFolder)
until just before the the build files are placed in the output folder? It's nice to be able to serve from the /dist without having to write any copy scripts!
@rossity i would prefer buidling the application in a vm/container/local.... and then publish that build (dist folder) to production.
@mstaack I use scripts to automatically push my code to the production server whenever I push to the master branch of my version control. Trying to automate it as much as possible! I don't like including the /dist folder (or built files) in version control which is why I don't build locally.
@rossity ok... sounds good ;)
Quick and dirty solution for anyone who runs across this
scripts
with a file named transfer.js
const fs = require('fs-extra')
const folder = process.argv[2]
async function execute() {
try {
await fs.emptyDir('./public')
console.log('Deleted public folder contents!')
await fs.copy(./dist/${folder}
, './public', { overwrite: true })
console.log('Installed new files in public folder!')
} catch (err) {
console.error(err)
}
}
execute()
2. In `package.json`
```js
"scripts": {
"transfer": "node scripts/transfer.js"
}
yarn transfer <folder-name>
with <folder-name>
being whatever build the project is: spa-mat
, 'pwa-ios` etc.Tweak it however you like but that worked well for me and is pretty fast even for a large project, thanks @rstoenescu for the idea!
When running
quasar build
, the current process isdist/<build-type>
dist/<build-type>
I'm running
quasar build
as part of the deployment process on my server so that results in a large gap of time where the server can't find any files for the project. Would it be possible to change the process so it goes:dist/<build-type>
dist/<build-type>
That way there is virtually no downtime on the production app!