Answer the question
In order to leave comments, you need to log in
How to build 2 different bundles on Vue-cli 3?
There is a task to run the application in parts on Vue. First admin , then public. Many components are used from each other. According to the structure, it would be logical to create it like this:
my-app/
+- ...
+- dist/
| +- admin/ Админка
| +- public/ Для пользователей
+- src/
| +- components/ Общие компоненты
| +- admin/ Entry point, router, store... для админки
| +- public/ Entry point, router, store... для пользователей
+- ...
module.exports = {
// tweak internal webpack configuration.
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: config => {
// If you wish to remove the standard entry point
config.entryPoints.delete('app')
// then add your own
config.entry('admin')
.add('./src/admin/index.js')
.end()
.entry('public')
.add('./src/public/index.js')
.end()
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question