mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-10-30 23:37:28 +03:00 
			
		
		
		
	Add gulp copydebug task
This commit is contained in:
		
							parent
							
								
									6f8ea60da7
								
							
						
					
					
						commit
						f2b1ba8cda
					
				|  | @ -24,10 +24,18 @@ gulp.task('build', function (callback) { | ||||||
|     'concatPrism', |     'concatPrism', | ||||||
|     'bundle', |     'bundle', | ||||||
|     'concatDeps', |     'concatDeps', | ||||||
|  |     'copyDebug', | ||||||
|     callback |     callback | ||||||
|   ); |   ); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | gulp.task('copyDebug', () => { | ||||||
|  |   if (!argv.prod) { | ||||||
|  |     // copy for be accessible from demo for debug
 | ||||||
|  |     cp(paths.redocBuilt + '.js', paths.redocBuilt + '.min.js'); | ||||||
|  |   } | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| gulp.task('rebuild', function(done) { | gulp.task('rebuild', function(done) { | ||||||
|   return runSequence( |   return runSequence( | ||||||
|     'bundle', |     'bundle', | ||||||
|  | @ -73,7 +81,7 @@ gulp.task('concatDeps', function() { | ||||||
|     .pipe(gulp.dest('.')) |     .pipe(gulp.dest('.')) | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| gulp.task('bundle', ['injectVersionFile', 'inlineTemplates'], function bundle(cb) { | gulp.task('bundle', ['injectVersionFile', 'inlineTemplates'], function bundle(done) { | ||||||
|   fs.existsSync('dist') || fs.mkdirSync('dist'); |   fs.existsSync('dist') || fs.mkdirSync('dist'); | ||||||
|   var builder = new Builder('./', 'system.config.js'); |   var builder = new Builder('./', 'system.config.js'); | ||||||
| 
 | 
 | ||||||
|  | @ -82,13 +90,11 @@ gulp.task('bundle', ['injectVersionFile', 'inlineTemplates'], function bundle(cb | ||||||
|       outputFileName, |       outputFileName, | ||||||
|       { format:'umd', sourceMaps: !argv.prod, lowResSourceMaps: true, minify: argv.prod } |       { format:'umd', sourceMaps: !argv.prod, lowResSourceMaps: true, minify: argv.prod } | ||||||
|     ) |     ) | ||||||
|     .then(function() { |     .then(() => { | ||||||
|       // wait some time to allow flush
 |       // wait some time to allow flush
 | ||||||
|       setTimeout(() => cb(), 500); |       setTimeout(() => done(), 500); | ||||||
|     }) |     }) | ||||||
|     .catch(function(err) { |     .catch(err => done(err)); | ||||||
|       cb(new Error(err)); |  | ||||||
|     }); |  | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| gulp.task('concatPrism', function() { | gulp.task('concatPrism', function() { | ||||||
|  |  | ||||||
|  | @ -18,7 +18,6 @@ | ||||||
| 
 | 
 | ||||||
|     <redoc scroll-y-offset="body > nav" spec-url='http://rebilly.github.io/SwaggerTemplateRepo/swagger.yaml'></redoc> |     <redoc scroll-y-offset="body > nav" spec-url='http://rebilly.github.io/SwaggerTemplateRepo/swagger.yaml'></redoc> | ||||||
| 
 | 
 | ||||||
|     <!-- ReDoc built file with all dependencies included --> |  | ||||||
|     <script src="main.js"> </script> |     <script src="main.js"> </script> | ||||||
|     <script src="dist/redoc.min.js"> </script> |     <script src="dist/redoc.min.js"> </script> | ||||||
|   </body> |   </body> | ||||||
|  |  | ||||||
|  | @ -1 +1,2 @@ | ||||||
|  | require('shelljs/global'); | ||||||
| require('require-dir')('build/tasks'); | require('require-dir')('build/tasks'); | ||||||
|  |  | ||||||
|  | @ -106,6 +106,7 @@ | ||||||
|     "reflect-metadata": "^0.1.2", |     "reflect-metadata": "^0.1.2", | ||||||
|     "require-dir": "^0.3.0", |     "require-dir": "^0.3.0", | ||||||
|     "run-sequence": "^1.1.5", |     "run-sequence": "^1.1.5", | ||||||
|  |     "shelljs": "^0.7.0", | ||||||
|     "should": "^8.0.2", |     "should": "^8.0.2", | ||||||
|     "sinon": "^1.17.2", |     "sinon": "^1.17.2", | ||||||
|     "systemjs-builder": "^0.15.16", |     "systemjs-builder": "^0.15.16", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user