Nuxt.js: Allow nuxt build command to choice config file

Created on 15 Mar 2017  ·  9Comments  ·  Source: nuxt/nuxt.js

Hi,

The nuxt.config.js file path is written in the code of the nuxt build command. But the problem is that this file is not always located at root directory, and it can be cool to allow developers to choice the path of this configuration file.

For example:

.
+-- config
|   +-- general.config.js
|   +-- nuxt.config.js
|   +-- api.config.js
|   +-- styles.config.js
+-- pages
|   +-- index.vue
+-- layouts
|   +-- default.vue
|   +-- post.vue
+-- store
|   +-- index.js
...

I want to use

$ nuxt build -c /path/to/project/config/nuxt.config.js /path/to/project
$ # or 
$ nuxt build --config-file /path/to/project/config/nuxt.config.js /path/to/project

Can be useful to automatize deployments :D

This feature request is available on Nuxt.js community (#c342)
available soon enhancement

Most helpful comment

@Atinux Dunno if adding and equivalent of argparse can be a good idea but I can have a look to add this for the future of this project. (NuxtJs and VuejS make me like Javascript o/)

All 9 comments

Hi @PierreRambaud

I'd love to see a PR for that 👍

@Atinux Dunno if adding and equivalent of argparse can be a good idea but I can have a look to add this for the future of this project. (NuxtJs and VuejS make me like Javascript o/)

You don't need argparse, take a look at this: https://github.com/nuxt/nuxt.js/blob/master/bin/nuxt-build#L11

Yes, that's what I did for the PR :)

Thanks for merge @Atinux ;)

This issue maybe should be closed and add to Milestone 0.10 ?

I will close it when the 0.10 will be out @PierreRambaud

The 0.10 release it out ✋

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bimohxh picture bimohxh  ·  3Comments

pehbehbeh picture pehbehbeh  ·  3Comments

lazycrazy picture lazycrazy  ·  3Comments

jaredreich picture jaredreich  ·  3Comments

VincentLoy picture VincentLoy  ·  3Comments