@@ -32,6 +32,8 @@ const addComponentTo = (obj, component) => {
32
32
33
33
async function run ( ) {
34
34
program . option ( "-d, --dot" , "Look for Bookshops inside . directories" ) ;
35
+ program . option ( "--skip-live" , "Don't build live editing JS or add live editing scripts to HTML" ) ;
36
+ program . option ( "--skip-components" , "Don't build the component browser JS or add component browser scripts to HTML" ) ;
35
37
program . parse ( process . argv ) ;
36
38
const options = program . opts ( ) ;
37
39
@@ -94,14 +96,22 @@ async function run() {
94
96
fs . writeFileSync ( infoJsonFile , JSON . stringify ( info_json , null , 2 ) ) ;
95
97
console . log ( `📚 ———— Added components as CloudCannon Structures` ) ;
96
98
97
- const liveEditingNeeded = await hydrateLiveForSite ( siteRoot , options ) ;
98
- if ( liveEditingNeeded ) {
99
- await buildLiveScript ( siteRoot , bookshopRoots ) ;
99
+ if ( ! options . skipLive ) {
100
+ const liveEditingNeeded = await hydrateLiveForSite ( siteRoot , options ) ;
101
+ if ( liveEditingNeeded ) {
102
+ await buildLiveScript ( siteRoot , bookshopRoots ) ;
103
+ }
104
+ } else {
105
+ console . log ( `📚 ———— Skipping live editing generation` ) ;
100
106
}
101
107
102
- const componentBrowserNeeded = await hydrateComponentBrowserForSite ( siteRoot , options ) ;
103
- if ( componentBrowserNeeded ) {
104
- await buildBrowserScript ( siteRoot , bookshopRoots ) ;
108
+ if ( ! options . skipComponents ) {
109
+ const componentBrowserNeeded = await hydrateComponentBrowserForSite ( siteRoot , options ) ;
110
+ if ( componentBrowserNeeded ) {
111
+ await buildBrowserScript ( siteRoot , bookshopRoots ) ;
112
+ }
113
+ } else {
114
+ console . log ( `📚 ———— Skipping component browser generation` ) ;
105
115
}
106
116
}
107
117
0 commit comments