@@ -21,6 +21,7 @@ const {
21
21
port : portStr ,
22
22
count : countStr ,
23
23
noHeadless,
24
+ devBuild,
24
25
} ,
25
26
} = parseArgs ( {
26
27
allowNegative : true ,
@@ -58,6 +59,10 @@ const {
58
59
noHeadless : {
59
60
type : 'boolean' ,
60
61
} ,
62
+ devBuild : {
63
+ type : 'boolean' ,
64
+ short : 'd' ,
65
+ } ,
61
66
} ,
62
67
} )
63
68
@@ -87,10 +92,11 @@ async function buildLib() {
87
92
cwd : path . resolve ( import . meta. dirname , '..' ) ,
88
93
stdio : 'inherit' ,
89
94
}
95
+ const BuildOptions = devBuild ? '-df' : '-pf'
90
96
const [ { ok } , { ok : ok2 } , { ok : ok3 } , { ok : ok4 } ] = await Promise . all ( [
91
97
exec (
92
98
'pnpm' ,
93
- ' run --silent build shared compiler-core compiler-dom compiler-vapor -pf cjs' . split (
99
+ ` run --silent build shared compiler-core compiler-dom compiler-vapor ${ BuildOptions } cjs` . split (
94
100
' ' ,
95
101
) ,
96
102
options ,
@@ -102,12 +108,12 @@ async function buildLib() {
102
108
) ,
103
109
exec (
104
110
'pnpm' ,
105
- ' run --silent build vue-vapor -pf esm-browser' . split ( ' ' ) ,
111
+ ` run --silent build vue-vapor ${ BuildOptions } esm-browser` . split ( ' ' ) ,
106
112
options ,
107
113
) ,
108
114
exec (
109
115
'pnpm' ,
110
- ' run --silent build vue -pf esm-browser-runtime' . split ( ' ' ) ,
116
+ ` run --silent build vue ${ BuildOptions } esm-browser-runtime` . split ( ' ' ) ,
111
117
options ,
112
118
) ,
113
119
] )
@@ -128,17 +134,19 @@ async function buildApp(isVapor) {
128
134
const CompilerSFC = await import (
129
135
'../packages/compiler-sfc/dist/compiler-sfc.cjs.js'
130
136
)
137
+ const prodSuffix = devBuild ? '.js' : '.prod.js'
138
+
131
139
/** @type {any } */
132
140
const TemplateCompiler = await import (
133
- isVapor
134
- ? '../packages/compiler-vapor/dist/compiler-vapor.cjs.prod.js '
135
- : '../packages/compiler-dom/dist/compiler-dom.cjs.prod.js'
141
+ ( isVapor
142
+ ? '../packages/compiler-vapor/dist/compiler-vapor.cjs'
143
+ : '../packages/compiler-dom/dist/compiler-dom.cjs' ) + prodSuffix
136
144
)
137
145
const runtimePath = path . resolve (
138
146
import . meta. dirname ,
139
- isVapor
140
- ? '../packages/vue-vapor/dist/vue-vapor.esm-browser.prod.js '
141
- : '../packages/vue/dist/vue.runtime.esm-browser.prod.js' ,
147
+ ( isVapor
148
+ ? '../packages/vue-vapor/dist/vue-vapor.esm-browser'
149
+ : '../packages/vue/dist/vue.runtime.esm-browser' ) + prodSuffix ,
142
150
)
143
151
144
152
const mode = isVapor ? 'vapor' : 'vdom'
@@ -149,7 +157,7 @@ async function buildApp(isVapor) {
149
157
'import.meta.env.IS_VAPOR' : String ( isVapor ) ,
150
158
} ,
151
159
build : {
152
- minify : 'terser' ,
160
+ minify : ! devBuild && 'terser' ,
153
161
outDir : path . resolve ( './client/dist' , mode ) ,
154
162
rollupOptions : {
155
163
onwarn ( log , handler ) {
0 commit comments