@@ -4,6 +4,12 @@ const defaults = {
4
4
entry : 'src/App.vue'
5
5
}
6
6
7
+ const buildModes = {
8
+ lib : 'library (commonjs + umd)' ,
9
+ wc : 'web component' ,
10
+ 'wc-async' : 'web component (async)'
11
+ }
12
+
7
13
module . exports = ( api , options ) => {
8
14
api . registerCommand ( 'build' , {
9
15
description : 'build for production' ,
@@ -42,7 +48,12 @@ module.exports = (api, options) => {
42
48
if ( args . target === 'app' ) {
43
49
logWithSpinner ( `Building for production...` )
44
50
} else {
45
- logWithSpinner ( `Building for production as ${ args . target } ...` )
51
+ const buildMode = buildModes [ args . target ]
52
+ if ( buildMode ) {
53
+ logWithSpinner ( `Building for production as ${ buildMode } ...` )
54
+ } else {
55
+ throw new Error ( `Unknonw build target: ${ args . target } ` )
56
+ }
46
57
}
47
58
48
59
return new Promise ( ( resolve , reject ) => {
@@ -55,8 +66,6 @@ module.exports = (api, options) => {
55
66
if ( args . target === 'lib' ) {
56
67
webpackConfig = require ( './resolveLibConfig' ) ( api , args , options )
57
68
} else if (
58
- args . target === 'web-component' ||
59
- args . target === 'web-component-async' ||
60
69
args . target === 'wc' ||
61
70
args . target === 'wc-async'
62
71
) {
0 commit comments