File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,16 @@ global.extraArgs = program.args;
1616
1717const type = program . type ;
1818if ( type === 'vusion' ) {
19- microApp . vusionAdapter . build ( ) . then ( ( ) => {
19+ const vusionAdapter = new microApp . VusionAdapter ( ) ;
20+ vusionAdapter . build ( ) . then ( ( ) => {
2021 console . info ( '>>> Build Success >>>' ) ;
2122 } ) . catch ( e => {
2223 console . error ( '>>> Build Error >>>' , e ) ;
2324 } ) ;
2425} else if ( ! type || type === 'webpack' ) {
2526 // webpack build ...
26- microApp . webpackAdapter . build ( ) . then ( ( ) => {
27+ const webpackAdapter = new microApp . WebpackAdapter ( ) ;
28+ webpackAdapter . build ( ) . then ( ( ) => {
2729 console . info ( '>>> Build Success >>>' ) ;
2830 } ) . catch ( e => {
2931 console . error ( '>>> Build Error >>>' , e ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ process.env.NODE_ENV = 'development';
2121
2222global . extraArgs = program . args ;
2323
24- microApp . koaAdapter . devHot ( program , url => {
24+ const wbpackAdapter = program . type === 'vusion' ? new microApp . VusionAdapter ( ) : new microApp . WebpackAdapter ( ) ;
25+ const koaAdapter = new microApp . KoaAdapter ( wbpackAdapter , program ) ;
26+ koaAdapter . devHot ( url => {
2527 // success
2628 if ( program . openBrowser ) {
2729 opn ( url ) ;
Original file line number Diff line number Diff line change @@ -22,12 +22,14 @@ let promise = Promise.resolve();
2222if ( program . build ) {
2323 const type = program . type ;
2424 if ( type === 'vusion' ) {
25- promise = microApp . vusionAdapter . build ( ) . then ( ( ) => {
25+ const vusionAdapter = new microApp . VusionAdapter ( ) ;
26+ promise = vusionAdapter . build ( ) . then ( ( ) => {
2627 return Promise . resolve ( true ) ;
2728 } ) ;
2829 } else {
2930 // webpack build ...
30- promise = microApp . webpackAdapter . build ( ) . then ( ( ) => {
31+ const webpackAdapter = new microApp . WebpackAdapter ( ) ;
32+ promise = webpackAdapter . build ( ) . then ( ( ) => {
3133 return Promise . resolve ( true ) ;
3234 } ) ;
3335 }
@@ -37,7 +39,9 @@ promise.then(flag => {
3739 if ( flag ) {
3840 logger . success ( 'Build finish' ) ;
3941 }
40- microApp . koaAdapter . runServer ( program , url => {
42+ const wbpackAdapter = program . type === 'vusion' ? new microApp . VusionAdapter ( ) : new microApp . WebpackAdapter ( ) ;
43+ const koaAdapter = new microApp . KoaAdapter ( wbpackAdapter , program ) ;
44+ koaAdapter . runServer ( url => {
4145 // success
4246 logger . info ( `Open Browser, URL: ${ chalk . yellow ( url ) } ` ) ;
4347 } ) ;
You can’t perform that action at this time.
0 commit comments