File tree Expand file tree Collapse file tree 4 files changed +32
-25
lines changed Expand file tree Collapse file tree 4 files changed +32
-25
lines changed Original file line number Diff line number Diff line change 1
1
import * as exvite from '../..' ;
2
+ import { getInternalConfig } from '../../utils/getInternalConfig' ;
2
3
import { defineCommand } from '../utils/defineCommand' ;
3
4
4
- export const build = defineCommand ( async ( root : any , { mode, config } : any ) => {
5
- await exvite . build ( {
6
- mode,
7
- root,
8
- configFile : config ,
9
- } ) ;
10
- } ) ;
5
+ export const build = defineCommand (
6
+ async ( root : any , { mode, config : configFile } : any ) => {
7
+ const cliConfig : exvite . InlineConfig = { root, mode, configFile } ;
8
+ const config = await getInternalConfig ( cliConfig , mode ) ;
9
+
10
+ await exvite . build ( config ) ;
11
+ } ,
12
+ ) ;
Original file line number Diff line number Diff line change 1
1
import * as exvite from '../..' ;
2
2
import { defineCommand } from '../utils/defineCommand' ;
3
3
4
- export const dev = defineCommand ( async ( root : any , { mode, config } : any ) => {
5
- await exvite . createServer ( {
6
- mode,
7
- root,
8
- configFile : config ,
9
- } ) ;
10
- } ) ;
4
+ export const dev = defineCommand (
5
+ async ( root : any , { mode, config : configFile } : any ) => {
6
+ const cliConfig : exvite . InlineConfig = {
7
+ mode,
8
+ root,
9
+ configFile,
10
+ } ;
11
+ await exvite . createServer ( cliConfig ) ;
12
+ } ,
13
+ ) ;
Original file line number Diff line number Diff line change @@ -2,16 +2,16 @@ import { getInternalConfig } from '../../utils/getInternalConfig';
2
2
import { findEntrypoints } from '../../utils/findEntrypoints' ;
3
3
import { generateTypesDir } from '../../utils/generateTypesDir' ;
4
4
import { defineCommand } from '../utils/defineCommand' ;
5
+ import * as exvite from '../..' ;
5
6
6
7
export const prepare = defineCommand (
7
- async ( root : any , { mode, config } : any ) => {
8
- const internalConfig = await getInternalConfig (
9
- { root, mode, configFile : config } ,
10
- 'build' ,
11
- ) ;
12
- internalConfig . logger . info ( 'Generating types...' ) ;
8
+ async ( root : any , { mode, config : configFile } : any ) => {
9
+ const cliConfig : exvite . InlineConfig = { root, mode, configFile } ;
10
+ const config = await getInternalConfig ( cliConfig , 'build' ) ;
13
11
14
- const entrypoints = await findEntrypoints ( internalConfig ) ;
15
- await generateTypesDir ( entrypoints , internalConfig ) ;
12
+ config . logger . info ( 'Generating types...' ) ;
13
+
14
+ const entrypoints = await findEntrypoints ( config ) ;
15
+ await generateTypesDir ( entrypoints , config ) ;
16
16
} ,
17
17
) ;
Original file line number Diff line number Diff line change 1
1
import { consola } from 'consola' ;
2
2
import { defineCommand } from '../utils/defineCommand' ;
3
3
4
- export const publish = defineCommand ( async ( root : any , { config } : any ) => {
5
- consola . warn ( 'exvite publish: Not implemented' ) ;
6
- } ) ;
4
+ export const publish = defineCommand (
5
+ async ( root : any , { config : configFile } : any ) => {
6
+ consola . warn ( 'exvite publish: Not implemented' ) ;
7
+ } ,
8
+ ) ;
You can’t perform that action at this time.
0 commit comments