is it possible to have multiple vue apps in one project?

I'm trying to create a set up similar to what we currently have at my job.  We have a .net project that has 3 what we call portals where different types of users can log in.  Something like

>Root
    >Recruiter
    >Employee
    >Clients

Within each portal, each one has it's own sidebar of links, reports, etc.  So, I want to create a vue app for each subfolder/portal.  I'm not sure how to set this up or if this is even possible?  If not possible, do I have then create a project for each portal?  If I do, then I'm not sure about how to share components between all three.  I'd appreciate any advice and guidance.  Thank you!

0
5 comments

After a lot of googling, I came across this where it looks like I can create this scenario with the vue.config.js file.

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,

pages: {
app1: {
entry: 'src/clients/main.js',
template: 'public/client.html',
filename: 'client.html',
title: 'Clients',
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
app2: {
entry: 'src/recruiters/main.js',
template: 'public/recruiter.html',
filename: 'recruiter.html',
title: 'Recruiters',
chunks: ['chunk-vendors', 'chunk-common', 'index']
}
}
})

If I run npm run build, it creates a production version as expected, however I can't get a development version working.  So I think I'm getting somewhere, just not sure how to get it working for dev.  Here's a screenshot of my project.

0

please could you elaborate on this? What do you mean saying that you can't get a development version working? Also, what would you expect from the IDE here?

0

I guess the confusion for me is how the main vue script is injected into the development public/index.html page.  And, then how do I set it up so that the main.js file in the clients folder is also injected into public/client.html file?  Because, when I run the app using npm run serve and I try to navigate to clients.html, there's no vue script reference.  I suppose this is probably more of a vue cli issue and not necessarily web storm.  But hopeful someone in the community here might have an idea.

0

I'd suggest posting this question to stackoverflow.com, this forum is for the IDE-related stuff mostly. At  stackoverflow.com you have more chances to get help from Vue.js community

0

Will do.  Thank you.

0

Please sign in to leave a comment.