Skip to content

Configuration for different environments (e.g. dev, int, prod) #244

@Doogiemuc

Description

@Doogiemuc

This boilerplat is awesome. There are dozens of others out there. But no other targets "enterprise grade" VUE setups.

Of course one of the most debatle question for any boilerplate is: What should be in it and what not?

On the one hand, you alreay include quite "detailed" tools like unhead. But on the other hand you do not have a mechanism to organize different config files for different environments. A feature that IMHO every enterprise vue application needs.

... I can provide one ... would you be interested in a PR?

Of course there are all the .env.<environment libs out there. But there is a simpler way. Vite builtin.

vite.config.js

resolve: {
    alias: {
			// load a specific config file per environment
			'config': path.join(__dirname, "config/config."+process.env.NODE_ENV)  
    }
},

and than in any component simply do import config from 'config'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions