Is vue.config.js file executed on building or starting the Vue App? - vue.js

I am using vue.config.js to inject configuration on App start.
It works on my dev machine, when I execute a vue-cli-service serve command.
As stated in docs, this command "starts a dev server".
I thought when my App is run inside a Docker pod, it would launch a similar command, but obviously, it is not the case because my configuration is not loaded.
So I may misunderstand the step where this file is used: building or starting?

Related

Codeship with Testim.io - Am I testing my latest version?

Sorry for the dumb question but I could not find an answer for that.
Codeship + Testim.io + Heroku.
In my Staging env - I use Testim.io to test the app once it deployed.
The following tutorial is guiding me how to invoke my tests - but I see the tests are being invoked BEFORE the new app has been deployed - so isn't it testing one version before my latest?
I expected the tests to run after the deploy.
Probably I am missing here something.
In that tutorial - the tests aren't supposed to run against your deployed version they are supposed to run against the version being tested.
The flow is:
You set up a local environment - for example by checking out your code and running npm start. If it's containerized then do that.
You run the Testim CLI and point its base url to local how testim --token ... --project ... --suite ... --base-url=localhost:PORT.
After the tests pass, you deploy.
If you test the version after you deploy you can't be sure the version deployed actually passes your tests.
An alternative flow would be to lean into Heroku's deployment model. Note this isn't actually specific to them and there are similar alternatives in aws/azure/gcp/whatever:
In your CI, you set up a staging environment in heroku heroku create --remote staging-BRANCH-NAME-<COMMIT-NAME>
You deploy there.
You run the tests against that enviroment (by passing --base-url to the Testim CLI, navigating there in your test or using a config file)
When tests pass you deploy to master

Add npm run build to Fortrabbit deploy process

Using Fortrabbit to deploy a PHP app which uses a node project for the front end. Is there any way in which I can add npm run build to the deploy process instead of having to always build first manually and then deploying it through Fortrabbit?
(There is a fortrabbit.yaml file on the fortrabbit site that needs to be configured for every fortrabbit app but the example doesn't show how we can add that command in the deployment pipeline.)
Sorry. There is no way to run Node JS during deployment on fortrabbit yet.

Nuxt webapp deployment through azure pipelines

i'm already thankfull for anyone reading this.
I've stumbled across some problems trying to deploy a Nuxt application in a correct way. For testing purposes i've created a clean installed Nuxt application so i'm sure nothing is wrong with my codebase. What my ultimate goal is is to push all my nuxt code to github which than gets picked up from a azure deployment pipeline and generates the needed build files and drops them to the webapp service and runs the needed start command. There's no documentation to be find about Azure which is really annoying for me. I'm not used to deploying stuff through a pipeline but need this to be working for this project.
Has anyone experience with Nuxt and deployments through Github -> Azure pipeline -> Build -> Web app running immediatly
What's i've tried already is pushing all the source code to a repository which get's picked up by azure pipeline. The only thing the pipeline does is paste the code in the wwwroot folder. Which is obviously not enough to make the application run automated.
What i expect is some insight from someone who is experienced with nuxt and azure deployments through github/bitbucket (doesn't really make a difference)
You have to configure your pipeline to build the nuxt files and deploy them. You can usually achieve the first step through npm commands, npm install then npm run build.
There's a few different ways to deploy them, which you'll have to decide between depending on your use case and environment. You can create an endpoint pointing to a CDN serving a blob, zip the built files and publish the artifact which is then used by a release pipeline, etc. Once the next files are created, you have all you need to deploy.

Recommended way to deploy Nuxt.js App with Express

I'm looking into using Nuxt.js for a new Web application with an Express server / API attached in the project itself. I've created the Nuxt.js application with the npx create-nuxt-app command and selected Express as "custom server framework".
When using the development environment (npm run dev), it works like a charm. Now, I want to deploy the application to a server which is running pm2 using Gitlab CI. I struggle with the right way to deploy the application, as I don't think I should "upload" the sourcecode to the server and then run the neccessary commands like npm run build or npm start. So, what is actually "the right way" to deploy this application with the server?
I have SSH access to a server where I want to deploy this application & API. The server is running pm2 for managing the Node processes.
Furthermore, the sourcecode is in a repository on a Gitlab server with a Gitlab CI Runner available. The current gitlab-ci.yml does the following:
npm install
npm run build
lftp the dist folder to the server
With a SPA, only the client is built and the server / API is not. We now have a, in my opinion, dirty workaround which doesn't work very well that does the following:
npm install
npm run build
mirror the whole project to the server
use a watcher in pm2 to detect changes in files
build project again???
It looks like it doesn't work as intended and I have the feeling we are creating problems instead of solving the deployment issue the right way. We don't use Heroku, Google or any other services for hosting the application, it's just a webhosting with SSH access basically.

How to Serve an Aurelia.io app without using Gulp watch

How do you run an Aurelia app without running gulp watch and just going to localhost:9000. Ideally I would like to just run my nodejs server and it all just works without having to run a separate task (a gulp task).
I would like to build Aurelia and just start using it in the same way that I can with Durandal.
take a look at the Aurelia-Node Repo for a quick start. It uses ExpressJS to provide a simple REST api as well as static serve the Aurelia App.
You'd still need the Gulp task (inside public/app) to build your es6 modules etc. but the hosting then works from node itself, so gulp build should be enough.
EDIT:
The repo provides a gulpfile in the root as well. The big difference using this one is that it not only transpiles the frontend code but also browserSyncs the node application via nodemon. Again all of this is not necessary for final hosting. A normal node app.js would be enough. Gulp etc. is just used during the development process.
I download Aurelia repository from
https://github.com/aurelia/
And run project successfully via webstrom on different port not on localhost:9000 without "gulp watch" .
But I installed Aurelia dependency then started project on webstorm its run successfully.
Steps for run project without "gulp watch"...
Run given command on command line from project folder.
Install the Apps dependencies - **npm install**
Install JSPM dependencies - **jspm install -y**
Install Gulp - **npm install gulp**
then explore your index.html page on chrome. Make sure you running Aurelia in Chrome, IE and Firefox.
I tested Aurelia application in Chrome, IE , Safari and Firefox result
Chrome - Pass
IE - Pass
Firefox - Pass
Safari - Fail
But in safari that was fail.