@@ -196,28 +196,6 @@ function (AlternativeSourceInterface $alternativeSource) {
196
196
$ this ->options = $ options ;
197
197
}
198
198
199
- /**
200
- * @param string $area
201
- * @param string $themePath
202
- * @return \Magento\RequireJs\Model\FileManager
203
- */
204
- private function getRequireJsFileManager ($ area , $ themePath )
205
- {
206
- $ design = $ this ->designFactory ->create ()->setDesignTheme ($ themePath , $ area );
207
- $ assetRepo = $ this ->assetRepoFactory ->create (['design ' => $ design ]);
208
- return $ this ->fileManagerFactory ->create (
209
- [
210
- 'config ' => $ this ->requireJsConfigFactory ->create (
211
- [
212
- 'assetRepo ' => $ assetRepo ,
213
- 'design ' => $ design ,
214
- ]
215
- ),
216
- 'assetRepo ' => $ assetRepo ,
217
- ]
218
- );
219
- }
220
-
221
199
/**
222
200
* {@inheritdoc}
223
201
*/
@@ -228,10 +206,7 @@ public function deploy($area, $themePath, $locale)
228
206
// emulate application locale needed for correct file path resolving
229
207
$ this ->localeResolver ->setLocale ($ locale );
230
208
231
- $ fileManager = $ this ->getRequireJsFileManager ($ area , $ themePath );
232
- if (!$ this ->getOption (Options::DRY_RUN )) {
233
- $ fileManager ->createRequireJsConfigAsset ();
234
- }
209
+ $ this ->deployRequireJsConfig ($ area , $ themePath );
235
210
$ this ->deployAppFiles ($ area , $ themePath , $ locale );
236
211
$ this ->deployLibFiles ($ area , $ themePath , $ locale );
237
212
@@ -240,16 +215,44 @@ public function deploy($area, $themePath, $locale)
240
215
$ dictionaryFileName = $ this ->jsTranslationConfig ->getDictionaryFileName ();
241
216
$ this ->deployFile ($ dictionaryFileName , $ area , $ themePath , $ locale , null );
242
217
}
243
- if ($ this ->minification ->isEnabled ('js ' ) && !$ this ->getOption (Options::DRY_RUN )) {
244
- $ fileManager ->createMinResolverAsset ();
245
- }
246
218
}
247
- $ this ->bundleManager ->flush ();
219
+ if (!$ this ->getOption (Options::NO_JAVASCRIPT )) {
220
+ $ this ->bundleManager ->flush ();
221
+ }
248
222
$ this ->output ->writeln ("\nSuccessful: {$ this ->count } files; errors: {$ this ->errorCount }\n--- \n" );
249
223
250
224
return $ this ->errorCount ? Cli::RETURN_FAILURE : Cli::RETURN_SUCCESS ;
251
225
}
252
226
227
+ /**
228
+ * @param string $area
229
+ * @param string $themePath
230
+ * @return void
231
+ */
232
+ private function deployRequireJsConfig ($ area , $ themePath )
233
+ {
234
+ if (!$ this ->getOption (Options::DRY_RUN ) && !$ this ->getOption (Options::NO_JAVASCRIPT )) {
235
+ $ design = $ this ->designFactory ->create ()->setDesignTheme ($ themePath , $ area );
236
+ $ assetRepo = $ this ->assetRepoFactory ->create (['design ' => $ design ]);
237
+ /** @var \Magento\RequireJs\Model\FileManager $fileManager */
238
+ $ fileManager = $ this ->fileManagerFactory ->create (
239
+ [
240
+ 'config ' => $ this ->requireJsConfigFactory ->create (
241
+ [
242
+ 'assetRepo ' => $ assetRepo ,
243
+ 'design ' => $ design ,
244
+ ]
245
+ ),
246
+ 'assetRepo ' => $ assetRepo ,
247
+ ]
248
+ );
249
+ $ fileManager ->createRequireJsConfigAsset ();
250
+ if ($ this ->minification ->isEnabled ('js ' )) {
251
+ $ fileManager ->createMinResolverAsset ();
252
+ }
253
+ }
254
+ }
255
+
253
256
/**
254
257
* @param string $area
255
258
* @param string $themePath
@@ -280,7 +283,7 @@ private function deployAppFiles($area, $themePath, $locale)
280
283
$ module ,
281
284
$ fullPath
282
285
);
283
- if ($ compiledFile !== '' ) {
286
+ if ($ compiledFile !== '' && ! $ this -> checkSkip ( $ compiledFile ) ) {
284
287
$ this ->deployFile ($ compiledFile , $ area , $ themePath , $ locale , $ module , $ fullPath );
285
288
}
286
289
}
@@ -303,7 +306,7 @@ private function deployLibFiles($area, $themePath, $locale)
303
306
304
307
$ compiledFile = $ this ->deployFile ($ filePath , $ area , $ themePath , $ locale , null );
305
308
306
- if ($ compiledFile !== '' ) {
309
+ if ($ compiledFile !== '' && ! $ this -> checkSkip ( $ compiledFile ) ) {
307
310
$ this ->deployFile ($ compiledFile , $ area , $ themePath , $ locale , null );
308
311
}
309
312
}
@@ -359,7 +362,9 @@ private function deployFile($filePath, $area, $themePath, $locale, $module, $ful
359
362
$ asset ->getContent ();
360
363
} else {
361
364
$ this ->assetPublisher ->publish ($ asset );
362
- $ this ->bundleManager ->addAsset ($ asset );
365
+ if (!$ this ->getOption (Options::NO_JAVASCRIPT )) {
366
+ $ this ->bundleManager ->addAsset ($ asset );
367
+ }
363
368
}
364
369
$ this ->count ++;
365
370
} catch (ContentProcessorException $ exception ) {
0 commit comments