-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Add prop in vue.config.js to change vue src directory #3040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I hesitant to add options for changing such basic and sensible defaults. We provide a way to adjust webpack, it should be used. I would rather like The community to come up with a collection recipes to do such adjustments than add option after potion to vue-cli |
@LinusBorg These options to change defaults will probably lead to greater adoption (especially by beginners), as it will make integrating Vue much easier in existing and complex projects. Right now the vue-cli defaults (from what I can tell) are tailored for SPA. Most of the web doesn't run on SPA and most businesses aren't going to rewrite existing apps, thereby possibly stalling adoption of newer versions of VueJS.
|
See #1134 (comment) Anyway, it is still reachable, though not that convenient. |
But @sodatea why do you believe it will lead to abuse? Nobody has outlined the actual cons for this change other than just "we prefer it this way and don't want users to change it". You can configure many directory preferences such as the Not changing the source directory seems like an unjustifiable preference that can't possibly lead to abuse any more than the current options provide. In the current system, if you want to change the directory (and then do so in the
Which is as immediately clear as options like |
@sam3d I think people should change the directory only after having fully understood what he/she's doing. |
That reasoning doesn’t make sense though. To do something as trivial as choosing where my code comes from, why should I have to trawl through the Vue CLI codebase to figure out how to it nondestructively? |
|
Uh oh!
There was an error while loading. Please reload this page.
What problem does this feature solve?
Having the Vue src files and directories in the /src directory works for simple projects, but for more complex projects it doesn't work as well. If you're including the Vuejs project in with another project with other programming languages that follow a different or same src dir causes problems. This feature will separate the vue code from the other project code (js/PHP/C#/Go/python/etc.)
Currently if you want to modify the vue src directory you need to modify
vue.config.js
:@
path.There might be other locations or properties that need to be updated with the change in
src
directory, but these 2 are the ones I've noticed so far.There is the
public
directory that should also be considered. I assume it would also be moved into the specified Vuesrc
directory or made into a separateweb.config.js
option.If this is already doable without all the customization mentioned above, let me know.
What does the proposed API look like?
vue.config.js
calledsrc
orvueSrc
orvueDir
orsrcDir
orvueSrcDir
or whatever is deemed appropriate.public
folder is also in the newvueSrc
path or create a separatepublicSrc
(orpublicDir
) option invue.config.js
.The value would be starting the current directory so you don't need to include the whole path.
Example: if you wanted to change the src vue directory and files from
src
towebclient/vue
.vue.config.js
The
vue-cli
would then change the vue src path where used by the cli-service.The 3 places I've seen so far are:
public
directory would also be located in thepathToVueSrc
or anothervue.config.js
option.Thanks!
Keep up the good work!
The text was updated successfully, but these errors were encountered: