I have a multi-page application and I need some pages to be displayed only in my development environment. This is my vue.config.js:
module.exports = { productionSourceMap: false, pages: { index: "src/main.js", admin: { entry: "src/main-admin.js", template: "public/index.html", filename: "admin" } } };
I need the index page to get into my production build, but remove the admin from it. Is there a way to add environment conditional configuration on vue.config.js, or add a vue.config.js for each environment?
vue.config.js
is javascript, so you can do almost anything you want in there. In your case you can do this:If you need more environments than the "built-in"
product
,development
, etc., you can create your own by creating a.env
file, For example, a file containing.env.myenv
, which containsNODE_ENV=myenv
https://cli.vuejs.org/guide/mode -and-env.html#mode