As common, we've got more systems than "prod" with different env config to build/deploy.
Is there a elegant solution to extend the build process within the template for another config/stage.env?
Goal should be this:
npm run build:demo => create demo bundle
npm run build:prod => create prod bundle
Currently I see nothing extendable in configuration and I don't want to rewrite the build stack, again.
I started working on this today, as a matter of fact. Will push a WIP PR as soon as I have tested it once, hopefully tonight.
Doing this cleanly requires some rewiring of the webpack configs and adjusting documentation, so I don't think it will be ready in the coming few days, but won't take weeks either.
Sidenote: previous discussions in #903
What we forgot: Separating config from code (build) would be a dream.
If you mean something like "config as a dependency", then That's what vue-cli v3 will bring, but that's still in the concept phase.
@LinusBorg Thanks for fast answers.
Would be nice if v3 includes this factor: https://12factor.net/config
Oh, that will be part of the PR I'm working on for this template.
I think we wording is confusing: we have a /config/index file which mostly has general, environment-independent app settings (and a few things overwriteable by env variables).
What is called "config" in your link is what I'm trying to improve, and part of that improvement will be .env file support and definition files for webpack in /config/environments for any number of deploy environments.
Please see #1163
@LinusBorg Do you have a test version we could try out?
@solidevolution I think @LinusBorg meant #1178
I followed the development #1178 and it solves multiple builds.
In this first step, it doesn't improve the complete idea of an atomic build (no differences between the bundle on all stages, remove config from code)
For me an atomic SPA build has minimum the following files:
index.html
files/app.css
files/app.js
static/*
plus some environment dependent files like:
robots.txt
config.js
But yes, it differs from the idea of multiple builds. The title should be "Ship builds to multiple stages"
Most helpful comment
I started working on this today, as a matter of fact. Will push a WIP PR as soon as I have tested it once, hopefully tonight.
Doing this cleanly requires some rewiring of the webpack configs and adjusting documentation, so I don't think it will be ready in the coming few days, but won't take weeks either.
Sidenote: previous discussions in #903