File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export default ({input, flags = {}}) => {
1212 options = { } ,
1313 output,
1414 root = './' ,
15+ skip = [ ] ,
1516 allInOutput = false
1617 } = flags ;
1718
@@ -66,6 +67,10 @@ export default ({input, flags = {}}) => {
6667 allInOutput = config . allInOutput ;
6768 }
6869
70+ if ( config ?. skip ) {
71+ skip = skip . concat ( config . skip ) ;
72+ }
73+
6974 input = [ ]
7075 . concat ( input && input . length > 0 ? input : config ?. input )
7176 . filter ( Boolean )
@@ -90,11 +95,14 @@ export default ({input, flags = {}}) => {
9095 output = normalizePath ( output ) ;
9196 }
9297
98+ skip = skip . map ( file => normalizePath ( path . join ( path . resolve ( root ) , file ) ) ) ;
99+
93100 return mergeOptions ( config ?? { } , {
94101 input,
95102 output,
96103 options,
97104 root,
98- allInOutput
105+ allInOutput,
106+ skip
99107 } , use ?? { } ) ;
100108} ;
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ const cli = meow(`
7171 type : 'boolean' ,
7272 default : false ,
7373 alias : 'a'
74+ } ,
75+ skip : {
76+ type : 'string' ,
77+ alias : 's' ,
78+ isMultiple : true
7479 }
7580 }
7681} ) ;
@@ -95,10 +100,15 @@ const config = cfgResolve(cli);
95100const processing = async file => {
96101 const output = await outResolve ( file , config ) ;
97102 const plugins = Array . isArray ( config . plugins ) ? config . plugins : getPlugins ( config ) ;
103+ const skipParse = config . skip . includes ( file ) ;
98104
99105 makeDir ( path . dirname ( output ) )
100106 . then ( read . bind ( undefined , file ) )
101- . then ( html => Promise . resolve ( posthtml ( plugins ) . process ( html , { ...config . options , from : file } ) ) )
107+ . then ( html => Promise . resolve ( posthtml ( plugins ) . process ( html , {
108+ ...config . options ,
109+ skipParse,
110+ from : file
111+ } ) ) )
102112 . then ( ( { html} ) => {
103113 fs . writeFile ( output , html , error => {
104114 if ( error ) {
You can’t perform that action at this time.
0 commit comments