File tree 1 file changed +8
-1
lines changed
packages/@vue/cli-service/lib/commands
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const defaults = {
13
13
module . exports = ( api , options ) => {
14
14
api . registerCommand ( 'serve' , {
15
15
description : 'start development server' ,
16
- usage : 'vue-cli-service serve [options]' ,
16
+ usage : 'vue-cli-service serve [options] [entry] ' ,
17
17
options : {
18
18
'--open' : `open browser on server start` ,
19
19
'--mode' : `specify env mode (default: development)` ,
@@ -42,6 +42,13 @@ module.exports = (api, options) => {
42
42
// resolve webpack config
43
43
const webpackConfig = api . resolveWebpackConfig ( )
44
44
45
+ const entry = args . _ [ 0 ]
46
+ if ( entry ) {
47
+ webpackConfig . entry = {
48
+ app : api . resolve ( entry )
49
+ }
50
+ }
51
+
45
52
// inject dev & hot-reload middleware entries
46
53
if ( ! isProduction ) {
47
54
const devClients = [
You can’t perform that action at this time.
1 commit comments
dabernathy89 commentedon May 20, 2018
Just FYI @yyx990803 - it seems that the
--open
option here expects an argument, so when I run this:vue-cli-service serve --open src/serve.js
It passes the entry argument into
--open
. Instead I have to do this:vue-cli-service serve --open foo src/serve.js