Changeset 33960
- Timestamp:
- 09/09/2015 02:11:23 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r33959 r33960 535 535 files: [ 536 536 SOURCE_DIR + '**', 537 '!' + SOURCE_DIR + 'wp-includes/js/media/**', 537 538 // Ignore version control directories. 538 539 '!' + SOURCE_DIR + '**/.{svn,git}/**' … … 550 551 '!' + SOURCE_DIR + 'wp-includes/js/media/*.manifest.js' 551 552 ], 552 tasks: ['browserify'] 553 tasks: ['browserify', 'copy:dynamic'], 554 options: { 555 spawn: false 556 } 553 557 }, 554 558 config: { … … 671 675 grunt.registerTask('default', ['build']); 672 676 673 // Add a listener to the watch task. 674 // 675 // On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic` 676 // configurations so that only the changed files are updated. 677 // On `watch:rtl`, automatically updates the `rtlcss:dynamic` configuration. 677 /* 678 * Automatically updates the `:dynamic` configurations 679 * so that only the changed files are updated. 680 */ 678 681 grunt.event.on('watch', function( action, filepath, target ) { 679 if ( target !== 'all' && target !== 'rtl' ) { 682 var src; 683 684 if ( [ 'all', 'rtl', 'browserify' ].indexOf( target ) === -1 ) { 680 685 return; 681 686 } 682 687 683 var relativePath = path.relative( SOURCE_DIR, filepath ), 684 cleanSrc = ( action === 'deleted' ) ? [relativePath] : [], 685 copySrc = ( action === 'deleted' ) ? [] : [relativePath]; 686 687 grunt.config(['clean', 'dynamic', 'src'], cleanSrc); 688 grunt.config(['copy', 'dynamic', 'src'], copySrc); 689 grunt.config(['rtlcss', 'dynamic', 'src'], copySrc); 688 src = [ path.relative( SOURCE_DIR, filepath ) ]; 689 if ( action === 'deleted' ) { 690 grunt.config( [ 'clean', 'dynamic', 'src' ], src ); 691 } else { 692 grunt.config( [ 'copy', 'dynamic', 'src' ], src ); 693 694 if ( target === 'rtl' ) { 695 grunt.config( [ 'rtlcss', 'dynamic', 'src' ], src ); 696 } 697 } 690 698 }); 691 699 };
Note: See TracChangeset
for help on using the changeset viewer.