Skip to content

Make vue scaffolding portable #4714

@davydnorris

Description

@davydnorris

What problem does this feature solve?

Not sure whether to log this as a bug or a feature so I went with the least offensive.

I have just decided to standardise on Vue as my front end, and am migrating my apps to use Vue and Vuetify (although looking at both Bootstrap and Carbon but that's not important). I just spent a very frustrating day trying to get a basic client/server scaffold working and am about ready to give up - performing the same task with Angular or React is so simple, but Vue has stumped me and I'm not sure it's possible.

I want the freedom to create applications that are a single deployment client/server, or that have separate processes serving client and server. Vue seems quite well designed for the latter, but is not happy when you try a single instance.

In the current case I created my Vue project in a directory under my root called './client' and I changed the package.json build to output the results of a Vue build into a top level './public' directory (I also left it alone and let it generate to './client/dist' with same results). I then set up an express server in a directory called './server' and defined a static route to './public'. Finally I moved node_modules and package.json up to the root, and adjusted the Vue build so that it built from the root.

When I ran the app, I found that the build created an empty node_modules directory under './client', but appeared to work, until I hit the main page and then I found all the Vuetify styling and CSS was missing - digging further and it appears that the build process expects node_modules to be directly inside the project and doesn't like it to be common.

What does the proposed API look like?

From an end user experience, I want the ability to have a correctly configured Vue front end living in a subdirectory of a top level project with any added plugins - I personally would be very happy with the existing scaffolding naming if it could be under its own subdirectory, but with the package.json and node_modules living somewhere else as a common asset.

I've seen existing feature requests (see #4584) that want fine-grained control over the names and locations of the individual directories - I just want control over one so that I can layout the fullstack properly.

As an added bonus, being able to reconfigure the app to have separate client and server projects by simply relocating package.json and re-running npm install would be great

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions