From 05f9f3adbcdc1bb1db4464bae3253717748e0326 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 3 May 2018 16:09:42 -0400 Subject: [PATCH] feat(serve): support entry in `vue-cli-service serve` close #974 --- packages/@vue/cli-service/lib/commands/serve.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/lib/commands/serve.js b/packages/@vue/cli-service/lib/commands/serve.js index c8d3a9fad2..3eed23c4ef 100644 --- a/packages/@vue/cli-service/lib/commands/serve.js +++ b/packages/@vue/cli-service/lib/commands/serve.js @@ -13,7 +13,7 @@ const defaults = { module.exports = (api, options) => { api.registerCommand('serve', { description: 'start development server', - usage: 'vue-cli-service serve [options]', + usage: 'vue-cli-service serve [options] [entry]', options: { '--open': `open browser on server start`, '--mode': `specify env mode (default: development)`, @@ -42,6 +42,13 @@ module.exports = (api, options) => { // resolve webpack config const webpackConfig = api.resolveWebpackConfig() + const entry = args._[0] + if (entry) { + webpackConfig.entry = { + app: api.resolve(entry) + } + } + // inject dev & hot-reload middleware entries if (!isProduction) { const devClients = [