Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Split Vue Config Files
"scripts": {
"serve": "vue-cli-service serve",
"build:admin": "rimraf vue.config.js && copy vue.configAdmin.js vue.config.js && vue-cli-service build --dest dist/admin src/admin/main.js && rimraf vue.config.js && copy vue.configDefault.js vue.config.js",
"build:client": "rimraf vue.config.js && copy vue.configClient.js vue.config.js && vue-cli-service build --dest dist/client src/client/main.js && rimraf vue.config.js && copy vue.configDefault.js vue.config.js",
"lint": "vue-cli-service lint"
},
const path = require('path')
module.exports = {
pages: {
admin: {
entry: 'src/admin/main.js',
template: 'public/index.html',
filename: 'index.html',
}
}
}
const path = require('path')
module.exports = {
pages: {
index: {
entry: 'src/client/main.js',
template: 'public/index.html',
filename: 'index.html',
}
}
}
const path = require('path')
module.exports = {
pages: {
index: {
entry: 'src/client/main.js',
template: 'public/index.html',
filename: 'index.html',
},
admin: {
entry: 'src/admin/main.js',
template: 'public/index.html',
filename: 'admin.html',
}
},
devServer: {
port: 8080,
historyApiFallback: {
rewrites: [
{ from: /^\/admin\/?.*/, to: path.posix.join('/', 'admin.html') },
{ from: /./, to: path.posix.join('/', 'index.html') }
]
}
}
}
@cristian-frumusanu

This comment has been minimized.

Copy link

@cristian-frumusanu cristian-frumusanu commented Apr 25, 2019

Saved my life, man!
Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment