File tree Expand file tree Collapse file tree
project-analyse-pages/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ pri.commands.registerCommand({
1212 alias : 'w' ,
1313 description : 'Watch only for component' ,
1414 } ,
15+ path : {
16+ alias : 'p' ,
17+ description : 'specify paths to build' ,
18+ } ,
1519 } ,
1620 description : text . commander . dev . description ,
1721 action : async ( options : any ) => {
Original file line number Diff line number Diff line change 11import * as _ from 'lodash' ;
22import * as normalizePath from 'normalize-path' ;
33import * as path from 'path' ;
4+ import * as yargs from 'yargs' ;
45import { pri } from '../../../node' ;
56import { md5 } from '../../../utils/md5' ;
67import { pagesPath , tempPath } from '../../../utils/structor-config' ;
@@ -71,9 +72,18 @@ pri.project.onAnalyseProject(files => {
7172 } ;
7273 }
7374
75+ const paths = ( ( yargs . argv . path ?? '' ) as string ) . split ( ',' ) . filter ( each => ! ! each ) ;
76+
7477 return {
7578 projectAnalysePages : {
7679 pages : pri . sourceConfig . routes
80+ . filter ( route => {
81+ if ( paths . length <= 0 ) {
82+ return true ;
83+ }
84+
85+ return paths . includes ( route . path ) ;
86+ } )
7787 . filter ( route => {
7888 if ( route . redirect && route . component ) {
7989 logFatal ( 'route "redirect" and "component" are mutually exclusive.' ) ;
You can’t perform that action at this time.
0 commit comments