Ticket #43731: wordpress-webpack.patch
File wordpress-webpack.patch, 73.0 KB (added by , 5 years ago) |
---|
-
Gruntfile.js
commit a59cc6bd2220bca7b3520a6fd7a8c407c3e1037e Author: Herre Groen <herre@yoast.com> Date: Thu Jun 20 13:43:30 2019 +0200 Build all JS with WebPack diff --git a/Gruntfile.js b/Gruntfile.js index 870e3e1305..f2b9e420ca 100644
a b module.exports = function(grunt) { 124 124 }, 125 125 qunit: ['tests/qunit/compiled.html'] 126 126 }, 127 file_append: {128 default_options: {129 files: [130 {131 append: 'jQuery.noConflict();',132 input: WORKING_DIR + 'wp-includes/js/jquery/jquery.js',133 output: WORKING_DIR + 'wp-includes/js/jquery/jquery.js'134 }135 ]136 }137 },138 127 copy: { 139 128 files: { 140 129 files: [ … … module.exports = function(grunt) { 162 151 } 163 152 ] 164 153 }, 165 'npm-packages': {166 files: [167 {168 [ WORKING_DIR + 'wp-includes/js/backbone.js' ]: [ './node_modules/backbone/backbone.js' ],169 [ WORKING_DIR + 'wp-includes/js/clipboard.js' ]: [ './node_modules/clipboard/dist/clipboard.js' ],170 [ WORKING_DIR + 'wp-includes/js/hoverIntent.js' ]: [ './node_modules/jquery-hoverintent/jquery.hoverIntent.js' ],171 [ WORKING_DIR + 'wp-includes/js/imagesloaded.min.js' ]: [ './node_modules/imagesloaded/imagesloaded.pkgd.min.js' ],172 [ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.js' ],173 [ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.min.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.min.js' ],174 [ WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js' ]: [ './node_modules/jquery-form/src/jquery.form.js' ],175 [ WORKING_DIR + 'wp-includes/js/masonry.min.js' ]: [ './node_modules/masonry-layout/dist/masonry.pkgd.min.js' ],176 [ WORKING_DIR + 'wp-includes/js/twemoji.js' ]: [ './node_modules/twemoji/2/twemoji.js' ],177 [ WORKING_DIR + 'wp-includes/js/underscore.js' ]: [ './node_modules/underscore/underscore.js' ],178 },179 {180 expand: true,181 cwd: './node_modules/jquery-ui/ui/',182 src: '*.js',183 dest: SOURCE_DIR + 'wp-includes/js/jquery/ui/'184 }185 ]186 },187 'vendor-js': {188 files: [189 {190 expand: true,191 cwd: SOURCE_DIR + 'js/_enqueues/vendor/',192 src: [193 '**/*',194 '!farbtastic.js',195 '!iris.min.js',196 '!deprecated/**',197 '!README.md',198 // Ignore unminified version of vendor lib we don't ship.199 '!jquery/jquery.masonry.js',200 '!tinymce/tinymce.js'201 ],202 dest: WORKING_DIR + 'wp-includes/js/'203 },204 {205 expand: true,206 cwd: SOURCE_DIR + 'js/_enqueues/vendor/',207 src: [208 'farbtastic.js',209 'iris.min.js'210 ],211 dest: WORKING_DIR + 'wp-admin/js/'212 },213 {214 expand: true,215 cwd: SOURCE_DIR + 'js/_enqueues/vendor/deprecated',216 src: [217 'suggest*'218 ],219 dest: WORKING_DIR + 'wp-includes/js/jquery/'220 },221 {222 expand: true,223 cwd: SOURCE_DIR + 'js/_enqueues/vendor/tinymce/',224 src: 'tinymce.js',225 dest: SOURCE_DIR + 'wp-includes/js/tinymce/'226 },227 228 ]229 },230 'admin-js': {231 files: {232 [ WORKING_DIR + 'wp-admin/js/accordion.js' ]: [ './src/js/_enqueues/lib/accordion.js' ],233 [ WORKING_DIR + 'wp-admin/js/code-editor.js' ]: [ './src/js/_enqueues/wp/code-editor.js' ],234 [ WORKING_DIR + 'wp-admin/js/color-picker.js' ]: [ './src/js/_enqueues/lib/color-picker.js' ],235 [ WORKING_DIR + 'wp-admin/js/comment.js' ]: [ './src/js/_enqueues/admin/comment.js' ],236 [ WORKING_DIR + 'wp-admin/js/common.js' ]: [ './src/js/_enqueues/admin/common.js' ],237 [ WORKING_DIR + 'wp-admin/js/custom-background.js' ]: [ './src/js/_enqueues/admin/custom-background.js' ],238 [ WORKING_DIR + 'wp-admin/js/custom-header.js' ]: [ './src/js/_enqueues/admin/custom-header.js' ],239 [ WORKING_DIR + 'wp-admin/js/customize-controls.js' ]: [ './src/js/_enqueues/wp/customize/controls.js' ],240 [ WORKING_DIR + 'wp-admin/js/customize-nav-menus.js' ]: [ './src/js/_enqueues/wp/customize/nav-menus.js' ],241 [ WORKING_DIR + 'wp-admin/js/customize-widgets.js' ]: [ './src/js/_enqueues/wp/customize/widgets.js' ],242 [ WORKING_DIR + 'wp-admin/js/dashboard.js' ]: [ './src/js/_enqueues/wp/dashboard.js' ],243 [ WORKING_DIR + 'wp-admin/js/edit-comments.js' ]: [ './src/js/_enqueues/admin/edit-comments.js' ],244 [ WORKING_DIR + 'wp-admin/js/editor-expand.js' ]: [ './src/js/_enqueues/wp/editor/dfw.js' ],245 [ WORKING_DIR + 'wp-admin/js/editor.js' ]: [ './src/js/_enqueues/wp/editor/base.js' ],246 [ WORKING_DIR + 'wp-admin/js/gallery.js' ]: [ './src/js/_enqueues/lib/gallery.js' ],247 [ WORKING_DIR + 'wp-admin/js/image-edit.js' ]: [ './src/js/_enqueues/lib/image-edit.js' ],248 [ WORKING_DIR + 'wp-admin/js/inline-edit-post.js' ]: [ './src/js/_enqueues/admin/inline-edit-post.js' ],249 [ WORKING_DIR + 'wp-admin/js/inline-edit-tax.js' ]: [ './src/js/_enqueues/admin/inline-edit-tax.js' ],250 [ WORKING_DIR + 'wp-admin/js/language-chooser.js' ]: [ './src/js/_enqueues/lib/language-chooser.js' ],251 [ WORKING_DIR + 'wp-admin/js/link.js' ]: [ './src/js/_enqueues/admin/link.js' ],252 [ WORKING_DIR + 'wp-admin/js/media-gallery.js' ]: [ './src/js/_enqueues/deprecated/media-gallery.js' ],253 [ WORKING_DIR + 'wp-admin/js/media-upload.js' ]: [ './src/js/_enqueues/admin/media-upload.js' ],254 [ WORKING_DIR + 'wp-admin/js/media.js' ]: [ './src/js/_enqueues/admin/media.js' ],255 [ WORKING_DIR + 'wp-admin/js/nav-menu.js' ]: [ './src/js/_enqueues/lib/nav-menu.js' ],256 [ WORKING_DIR + 'wp-admin/js/password-strength-meter.js' ]: [ './src/js/_enqueues/wp/password-strength-meter.js' ],257 [ WORKING_DIR + 'wp-admin/js/plugin-install.js' ]: [ './src/js/_enqueues/admin/plugin-install.js' ],258 [ WORKING_DIR + 'wp-admin/js/post.js' ]: [ './src/js/_enqueues/admin/post.js' ],259 [ WORKING_DIR + 'wp-admin/js/postbox.js' ]: [ './src/js/_enqueues/admin/postbox.js' ],260 [ WORKING_DIR + 'wp-admin/js/revisions.js' ]: [ './src/js/_enqueues/wp/revisions.js' ],261 [ WORKING_DIR + 'wp-admin/js/set-post-thumbnail.js' ]: [ './src/js/_enqueues/admin/set-post-thumbnail.js' ],262 [ WORKING_DIR + 'wp-admin/js/svg-painter.js' ]: [ './src/js/_enqueues/wp/svg-painter.js' ],263 [ WORKING_DIR + 'wp-admin/js/tags-box.js' ]: [ './src/js/_enqueues/admin/tags-box.js' ],264 [ WORKING_DIR + 'wp-admin/js/tags-suggest.js' ]: [ './src/js/_enqueues/admin/tags-suggest.js' ],265 [ WORKING_DIR + 'wp-admin/js/tags.js' ]: [ './src/js/_enqueues/admin/tags.js' ],266 [ WORKING_DIR + 'wp-admin/js/site-health.js' ]: [ './src/js/_enqueues/admin/site-health.js' ],267 [ WORKING_DIR + 'wp-admin/js/privacy-tools.js' ]: [ './src/js/_enqueues/admin/privacy-tools.js' ],268 [ WORKING_DIR + 'wp-admin/js/theme-plugin-editor.js' ]: [ './src/js/_enqueues/wp/theme-plugin-editor.js' ],269 [ WORKING_DIR + 'wp-admin/js/theme.js' ]: [ './src/js/_enqueues/wp/theme.js' ],270 [ WORKING_DIR + 'wp-admin/js/updates.js' ]: [ './src/js/_enqueues/wp/updates.js' ],271 [ WORKING_DIR + 'wp-admin/js/user-profile.js' ]: [ './src/js/_enqueues/admin/user-profile.js' ],272 [ WORKING_DIR + 'wp-admin/js/user-suggest.js' ]: [ './src/js/_enqueues/lib/user-suggest.js' ],273 [ WORKING_DIR + 'wp-admin/js/widgets/custom-html-widgets.js' ]: [ './src/js/_enqueues/wp/widgets/custom-html.js' ],274 [ WORKING_DIR + 'wp-admin/js/widgets/media-audio-widget.js' ]: [ './src/js/_enqueues/wp/widgets/media-audio.js' ],275 [ WORKING_DIR + 'wp-admin/js/widgets/media-gallery-widget.js' ]: [ './src/js/_enqueues/wp/widgets/media-gallery.js' ],276 [ WORKING_DIR + 'wp-admin/js/widgets/media-image-widget.js' ]: [ './src/js/_enqueues/wp/widgets/media-image.js' ],277 [ WORKING_DIR + 'wp-admin/js/widgets/media-video-widget.js' ]: [ './src/js/_enqueues/wp/widgets/media-video.js' ],278 [ WORKING_DIR + 'wp-admin/js/widgets/media-widgets.js' ]: [ './src/js/_enqueues/wp/widgets/media.js' ],279 [ WORKING_DIR + 'wp-admin/js/widgets/text-widgets.js' ]: [ './src/js/_enqueues/wp/widgets/text.js' ],280 [ WORKING_DIR + 'wp-admin/js/widgets.js' ]: [ './src/js/_enqueues/admin/widgets.js' ],281 [ WORKING_DIR + 'wp-admin/js/word-count.js' ]: [ './src/js/_enqueues/wp/utils/word-count.js' ],282 [ WORKING_DIR + 'wp-admin/js/wp-fullscreen-stub.js' ]: [ './src/js/_enqueues/deprecated/fullscreen-stub.js' ],283 [ WORKING_DIR + 'wp-admin/js/xfn.js' ]: [ './src/js/_enqueues/admin/xfn.js' ]284 }285 },286 'includes-js': {287 files: {288 [ WORKING_DIR + 'wp-includes/js/admin-bar.js' ]: [ './src/js/_enqueues/lib/admin-bar.js' ],289 [ WORKING_DIR + 'wp-includes/js/api-request.js' ]: [ './src/js/_enqueues/wp/api-request.js' ],290 [ WORKING_DIR + 'wp-includes/js/autosave.js' ]: [ './src/js/_enqueues/wp/autosave.js' ],291 [ WORKING_DIR + 'wp-includes/js/comment-reply.js' ]: [ './src/js/_enqueues/lib/comment-reply.js' ],292 [ WORKING_DIR + 'wp-includes/js/customize-base.js' ]: [ './src/js/_enqueues/wp/customize/base.js' ],293 [ WORKING_DIR + 'wp-includes/js/customize-loader.js' ]: [ './src/js/_enqueues/wp/customize/loader.js' ],294 [ WORKING_DIR + 'wp-includes/js/customize-models.js' ]: [ './src/js/_enqueues/wp/customize/models.js' ],295 [ WORKING_DIR + 'wp-includes/js/customize-preview-nav-menus.js' ]: [ './src/js/_enqueues/wp/customize/preview-nav-menus.js' ],296 [ WORKING_DIR + 'wp-includes/js/customize-preview-widgets.js' ]: [ './src/js/_enqueues/wp/customize/preview-widgets.js' ],297 [ WORKING_DIR + 'wp-includes/js/customize-preview.js' ]: [ './src/js/_enqueues/wp/customize/preview.js' ],298 [ WORKING_DIR + 'wp-includes/js/customize-selective-refresh.js' ]: [ './src/js/_enqueues/wp/customize/selective-refresh.js' ],299 [ WORKING_DIR + 'wp-includes/js/customize-views.js' ]: [ './src/js/_enqueues/wp/customize/views.js' ],300 [ WORKING_DIR + 'wp-includes/js/heartbeat.js' ]: [ './src/js/_enqueues/wp/heartbeat.js' ],301 [ WORKING_DIR + 'wp-includes/js/mce-view.js' ]: [ './src/js/_enqueues/wp/mce-view.js' ],302 [ WORKING_DIR + 'wp-includes/js/media-editor.js' ]: [ './src/js/_enqueues/wp/media/editor.js' ],303 [ WORKING_DIR + 'wp-includes/js/quicktags.js' ]: [ './src/js/_enqueues/lib/quicktags.js' ],304 [ WORKING_DIR + 'wp-includes/js/shortcode.js' ]: [ './src/js/_enqueues/wp/shortcode.js' ],305 [ WORKING_DIR + 'wp-includes/js/utils.js' ]: [ './src/js/_enqueues/lib/cookies.js' ],306 [ WORKING_DIR + 'wp-includes/js/wp-a11y.js' ]: [ './src/js/_enqueues/wp/a11y.js' ],307 [ WORKING_DIR + 'wp-includes/js/wp-ajax-response.js' ]: [ './src/js/_enqueues/lib/ajax-response.js' ],308 [ WORKING_DIR + 'wp-includes/js/wp-api.js' ]: [ './src/js/_enqueues/wp/api.js' ],309 [ WORKING_DIR + 'wp-includes/js/wp-auth-check.js' ]: [ './src/js/_enqueues/lib/auth-check.js' ],310 [ WORKING_DIR + 'wp-includes/js/wp-backbone.js' ]: [ './src/js/_enqueues/wp/backbone.js' ],311 [ WORKING_DIR + 'wp-includes/js/wp-custom-header.js' ]: [ './src/js/_enqueues/wp/custom-header.js' ],312 [ WORKING_DIR + 'wp-includes/js/wp-embed-template.js' ]: [ './src/js/_enqueues/lib/embed-template.js' ],313 [ WORKING_DIR + 'wp-includes/js/wp-embed.js' ]: [ './src/js/_enqueues/wp/embed.js' ],314 [ WORKING_DIR + 'wp-includes/js/wp-emoji-loader.js' ]: [ './src/js/_enqueues/lib/emoji-loader.js' ],315 [ WORKING_DIR + 'wp-includes/js/wp-emoji.js' ]: [ './src/js/_enqueues/wp/emoji.js' ],316 [ WORKING_DIR + 'wp-includes/js/wp-list-revisions.js' ]: [ './src/js/_enqueues/lib/list-revisions.js' ],317 [ WORKING_DIR + 'wp-includes/js/wp-lists.js' ]: [ './src/js/_enqueues/lib/lists.js' ],318 [ WORKING_DIR + 'wp-includes/js/wp-pointer.js' ]: [ './src/js/_enqueues/lib/pointer.js' ],319 [ WORKING_DIR + 'wp-includes/js/wp-sanitize.js' ]: [ './src/js/_enqueues/wp/sanitize.js' ],320 [ WORKING_DIR + 'wp-includes/js/wp-util.js' ]: [ './src/js/_enqueues/wp/util.js' ],321 [ WORKING_DIR + 'wp-includes/js/wpdialog.js' ]: [ './src/js/_enqueues/lib/dialog.js' ],322 [ WORKING_DIR + 'wp-includes/js/wplink.js' ]: [ './src/js/_enqueues/lib/link.js' ],323 [ WORKING_DIR + 'wp-includes/js/zxcvbn-async.js' ]: [ './src/js/_enqueues/lib/zxcvbn-async.js' ]324 }325 },326 154 'wp-admin-css-compat-rtl': { 327 155 options: { 328 156 processContent: function( src ) { … … module.exports = function(grunt) { 674 502 args: ['--verbose', '-c', 'phpunit.xml.dist', '--group', 'restapi-jsclient'] 675 503 } 676 504 }, 677 uglify: {678 options: {679 ASCIIOnly: true,680 screwIE8: false681 },682 core: {683 expand: true,684 cwd: WORKING_DIR,685 dest: WORKING_DIR,686 ext: '.min.js',687 src: [688 'wp-admin/js/**/*.js',689 'wp-includes/js/*.js',690 'wp-includes/js/plupload/*.js',691 'wp-includes/js/mediaelement/wp-mediaelement.js',692 'wp-includes/js/mediaelement/wp-playlist.js',693 'wp-includes/js/mediaelement/mediaelement-migrate.js',694 'wp-includes/js/tinymce/plugins/wordpress/plugin.js',695 'wp-includes/js/tinymce/plugins/wp*/plugin.js',696 697 // Exceptions698 '!**/*.min.js',699 '!wp-admin/js/custom-header.js', // Why? We should minify this.700 '!wp-admin/js/farbtastic.js',701 '!wp-includes/js/swfobject.js',702 '!wp-includes/js/wp-embed.js' // We have extra options for this, see uglify:embed703 ]704 },705 embed: {706 options: {707 compress: {708 conditionals: false709 }710 },711 expand: true,712 cwd: WORKING_DIR,713 dest: WORKING_DIR,714 ext: '.min.js',715 src: ['wp-includes/js/wp-embed.js']716 },717 jqueryui: {718 options: {719 // Preserve comments that start with a bang.720 preserveComments: /^!/721 },722 expand: true,723 cwd: 'node_modules/jquery-ui/ui/',724 dest: WORKING_DIR + 'wp-includes/js/jquery/ui/',725 ext: '.min.js',726 src: ['*.js']727 },728 imgareaselect: {729 src: WORKING_DIR + 'wp-includes/js/imgareaselect/jquery.imgareaselect.js',730 dest: WORKING_DIR + 'wp-includes/js/imgareaselect/jquery.imgareaselect.min.js'731 },732 jqueryform: {733 src: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js',734 dest: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js'735 },736 dynamic: {737 expand: true,738 cwd: WORKING_DIR,739 dest: WORKING_DIR,740 ext: '.min.js',741 src: []742 }743 },744 505 webpack: { 745 506 prod: webpackConfig( { environment: 'production', buildTarget: WORKING_DIR } ), 746 507 dev: webpackConfig( { environment: 'development', buildTarget: WORKING_DIR } ), 747 508 watch: webpackConfig( { environment: 'development', watch: true } ) 748 509 }, 749 concat: {750 tinymce: {751 options: {752 separator: '\n',753 process: function( src, filepath ) {754 return '// Source: ' + filepath.replace( WORKING_DIR, '' ) + '\n' + src;755 }756 },757 src: [758 WORKING_DIR + 'wp-includes/js/tinymce/tinymce.min.js',759 WORKING_DIR + 'wp-includes/js/tinymce/themes/modern/theme.min.js',760 WORKING_DIR + 'wp-includes/js/tinymce/plugins/*/plugin.min.js'761 ],762 dest: WORKING_DIR + 'wp-includes/js/tinymce/wp-tinymce.js'763 },764 emoji: {765 options: {766 separator: '\n',767 process: function( src, filepath ) {768 return '// Source: ' + filepath.replace( WORKING_DIR, '' ) + '\n' + src;769 }770 },771 src: [772 WORKING_DIR + 'wp-includes/js/twemoji.min.js',773 WORKING_DIR + 'wp-includes/js/wp-emoji.min.js'774 ],775 dest: WORKING_DIR + 'wp-includes/js/wp-emoji-release.min.js'776 }777 },778 510 patch:{ 779 511 options: { 780 512 file_mappings: { … … module.exports = function(grunt) { 1088 820 all: { 1089 821 files: [ 1090 822 SOURCE_DIR + '**', 1091 '!' + SOURCE_DIR + 'js/**/*.js ',823 '!' + SOURCE_DIR + 'js/**/*.js*', 1092 824 // Ignore version control directories. 1093 825 '!' + SOURCE_DIR + '**/.{svn,git}/**' 1094 826 ], … … module.exports = function(grunt) { 1098 830 spawn: false 1099 831 } 1100 832 }, 1101 'js-enqueues': {1102 files: [SOURCE_DIR + 'js/_enqueues/**/*.js'],1103 tasks: ['clean:dynamic', 'copy:dynamic-js', 'uglify:dynamic', 'jsvalidate:dynamic'],1104 options: {1105 dot: true,1106 spawn: false1107 }1108 },1109 'js-webpack': {1110 files: [1111 SOURCE_DIR + 'js/**/*.js',1112 '!' + SOURCE_DIR + 'js/_enqueues/**/*.js',1113 'webpack-dev.config.js'1114 ],1115 tasks: ['clean:dynamic', 'webpack:dev', 'uglify:dynamic', 'jsvalidate:dynamic'],1116 options: {1117 dot: true,1118 spawn: false1119 }1120 },1121 833 config: { 1122 834 files: [ 1123 835 'Gruntfile.js', … … module.exports = function(grunt) { 1145 857 ], 1146 858 tasks: ['qunit'] 1147 859 } 860 }, 861 concurrent: { 862 watch: { 863 tasks: ['_watch', 'webpack:watch'], 864 options: { 865 logConcurrentOutput: true 866 } 867 } 1148 868 } 1149 869 }); 1150 870 … … module.exports = function(grunt) { 1196 916 }; 1197 917 } 1198 918 1199 grunt.task.run( '_' + this.nameArgs ); 919 if ( this.nameArgs === 'watch' ) { 920 grunt.task.run( 'concurrent:watch' ); 921 } else if ( this.nameArgs === 'watch:webpack' ) { 922 grunt.task.run( 'webpack:watch' ); 923 } else { 924 grunt.task.run( '_' + this.nameArgs ); 925 } 926 1200 927 } ); 1201 928 1202 929 grunt.registerTask( 'precommit:image', [ … … module.exports = function(grunt) { 1206 933 grunt.registerTask( 'precommit:js', [ 1207 934 'webpack:prod', 1208 935 'jshint:corejs', 1209 'uglify:imgareaselect',1210 'uglify:jqueryform',1211 936 'qunit:compiled' 1212 937 ] ); 1213 938 … … module.exports = function(grunt) { 1336 1061 } 1337 1062 } ); 1338 1063 1339 grunt.registerTask( 'copy:js', [1340 'copy:npm-packages',1341 'copy:vendor-js',1342 'copy:admin-js',1343 'copy:includes-js'1344 ] );1345 1346 1064 grunt.registerTask( 'uglify:all', [ 1347 1065 'uglify:core', 1348 'uglify:embed',1349 'uglify:jqueryui',1350 'uglify:imgareaselect',1351 'uglify:jqueryform'1352 1066 ] ); 1353 1067 1354 1068 grunt.registerTask( 'build:js', [ 1355 1069 'clean:js', 1356 1070 'webpack:prod', 1357 1071 'webpack:dev', 1358 'copy:js',1359 'file_append',1360 'uglify:all',1361 'concat:tinymce',1362 'concat:emoji',1363 1072 'jsvalidate:build' 1364 1073 ] ); 1365 1074 … … module.exports = function(grunt) { 1460 1169 var src; 1461 1170 1462 1171 // Only configure the dynamic tasks based on known targets. 1463 if ( [ 'all', 'rtl' , 'webpack', 'js-enqueues', 'js-webpack'].indexOf( target ) === -1 ) {1172 if ( [ 'all', 'rtl' ].indexOf( target ) === -1 ) { 1464 1173 return; 1465 1174 } 1466 1175 1467 1176 // Normalize filepath for Windows. 1468 1177 filepath = filepath.replace( /\\/g, '/' ); 1469 1178 1470 // If the target is a file in the restructured js src. 1471 if ( target === 'js-enqueues' ) { 1472 var files = {}; 1473 var configs, dest; 1474 1475 // If it's a vendor file which are configured with glob matchers. 1476 if ( filepath.indexOf( SOURCE_DIR + 'js/_enqueues/vendor/' ) === 0 ) { 1477 // Grab the glob matchers from the copy task. 1478 configs = grunt.config( [ 'copy', 'vendor-js', 'files' ] ); 1479 1480 // For each glob matcher check if it matches and if so set the variables for our dynamic tasks. 1481 for ( var i = 0; i < configs.length; i++ ) { 1482 var config = configs[ i ]; 1483 var relative = path.relative( config.cwd, filepath ); 1484 var minimatch = require('minimatch'); 1485 1486 if ( minimatch.match( config.src, relative, {} ) ) { 1487 dest = config.dest + relative; 1488 src = [ path.relative( WORKING_DIR, dest ) ]; 1489 files[ dest ] = [ filepath ]; 1490 break; 1491 } 1492 } 1493 // Or if it's another file which has a straight mapping. 1494 } else { 1495 configs = Object.assign( {}, 1496 grunt.config( [ 'copy', 'admin-js', 'files' ] ), 1497 grunt.config( [ 'copy', 'includes-js', 'files' ] ) 1498 ); 1499 1500 for ( dest in configs ) { 1501 // If a file in the mapping matches then set the variables for our dynamic tasks. 1502 if ( dest && configs.hasOwnProperty( dest ) && configs[ dest ][0] === './' + filepath ) { 1503 files[ dest ] = configs[ dest ]; 1504 src = [ path.relative( WORKING_DIR, dest ) ]; 1505 break; 1506 } 1507 } 1508 } 1509 1510 // Configure our dynamic-js copy task which uses a file mapping rather than simply copying from src to build. 1511 if ( action !== 'deleted' ) { 1512 grunt.config( [ 'copy', 'dynamic-js', 'files' ], files ); 1513 } 1514 // For the webpack builds configure the jsvalidate task to only check those files build by webpack. 1515 } else if ( target === 'js-webpack' ) { 1516 src = [ 1517 'wp-includes/js/media-audiovideo.js', 1518 'wp-includes/js/media-grid.js', 1519 'wp-includes/js/media-models.js', 1520 'wp-includes/js/media-views.js' 1521 ]; 1522 // Else simply use the path relative to the source directory. 1523 } else { 1524 src = [ path.relative( SOURCE_DIR, filepath ) ]; 1525 } 1179 src = [ path.relative( SOURCE_DIR, filepath ) ]; 1526 1180 1527 1181 if ( ! src ) { 1528 1182 grunt.warn( 'Failed to determine the destination file.' ); … … module.exports = function(grunt) { 1536 1190 // Otherwise copy over only the changed file. 1537 1191 grunt.config( [ 'copy', 'dynamic', 'src' ], src ); 1538 1192 1539 // For javascript also minify and validate the changed file.1540 if ( target === 'js-enqueues' ) {1541 grunt.config( [ 'uglify', 'dynamic', 'src' ], src );1542 grunt.config( [ 'jsvalidate', 'dynamic', 'files', 'src' ], src.map( function( dir ) { return WORKING_DIR + dir; } ) );1543 }1544 // For webpack only validate the file, minification is handled by webpack itself.1545 if ( target === 'js-webpack' ) {1546 grunt.config( [ 'jsvalidate', 'dynamic', 'files', 'src' ], src.map( function( dir ) { return WORKING_DIR + dir; } ) );1547 }1548 1193 // For css run the rtl task on just the changed file. 1549 1194 if ( target === 'rtl' ) { 1550 1195 grunt.config( [ 'rtlcss', 'dynamic', 'src' ], src ); -
package-lock.json
diff --git a/package-lock.json b/package-lock.json index 10420ec231..c5d1a0bf86 100644
a b 26 26 "resolved": "https://registry.npmjs.org/@financial-times/useragent_parser/-/useragent_parser-1.0.2.tgz", 27 27 "integrity": "sha512-zuJMxn5Qnk7CKl+zrVXDqXs0F+p4tshO6B4s8VenJj34EEVuV4iZIbkGiEFJUbn29z9Mcn6k8yfj9qSCNDcPPQ==" 28 28 }, 29 "@mrmlnc/readdir-enhanced": { 30 "version": "2.2.1", 31 "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", 32 "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", 33 "dev": true, 34 "requires": { 35 "call-me-maybe": "^1.0.1", 36 "glob-to-regexp": "^0.3.0" 37 } 38 }, 39 "@nodelib/fs.stat": { 40 "version": "1.1.3", 41 "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", 42 "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", 43 "dev": true 44 }, 29 45 "@tannin/compile": { 30 46 "version": "1.0.3", 31 47 "resolved": "https://registry.npmjs.org/@tannin/compile/-/compile-1.0.3.tgz", … … 2768 2784 } 2769 2785 } 2770 2786 }, 2787 "call-me-maybe": { 2788 "version": "1.0.1", 2789 "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", 2790 "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", 2791 "dev": true 2792 }, 2771 2793 "caller-callsite": { 2772 2794 "version": "2.0.0", 2773 2795 "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", … … 2881 2903 }, 2882 2904 "chalk": { 2883 2905 "version": "1.1.3", 2884 "resolved": "http s://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",2906 "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 2885 2907 "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 2886 2908 "requires": { 2887 2909 "ansi-styles": "^2.2.1", … … 3388 3410 }, 3389 3411 "commander": { 3390 3412 "version": "2.8.1", 3391 "resolved": "http s://registry.npmjs.org/commander/-/commander-2.8.1.tgz",3413 "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", 3392 3414 "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", 3393 3415 "dev": true, 3394 3416 "optional": true, … … 3454 3476 } 3455 3477 } 3456 3478 }, 3479 "compression-webpack-plugin": { 3480 "version": "3.0.0", 3481 "resolved": "https://registry.npmjs.org/compression-webpack-plugin/-/compression-webpack-plugin-3.0.0.tgz", 3482 "integrity": "sha512-ls+oKw4eRbvaSv/hj9NmctihhBcR26j76JxV0bLRLcWhrUBdQFgd06z/Kgg7exyQvtWWP484wZxs0gIUX3NO0Q==", 3483 "dev": true, 3484 "requires": { 3485 "cacache": "^11.2.0", 3486 "find-cache-dir": "^3.0.0", 3487 "neo-async": "^2.5.0", 3488 "schema-utils": "^1.0.0", 3489 "serialize-javascript": "^1.4.0", 3490 "webpack-sources": "^1.0.1" 3491 }, 3492 "dependencies": { 3493 "find-cache-dir": { 3494 "version": "3.0.0", 3495 "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.0.0.tgz", 3496 "integrity": "sha512-t7ulV1fmbxh5G9l/492O1p5+EBbr3uwpt6odhFTMc+nWyhmbloe+ja9BZ8pIBtqFWhOmCWVjx+pTW4zDkFoclw==", 3497 "dev": true, 3498 "requires": { 3499 "commondir": "^1.0.1", 3500 "make-dir": "^3.0.0", 3501 "pkg-dir": "^4.1.0" 3502 } 3503 }, 3504 "find-up": { 3505 "version": "4.1.0", 3506 "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", 3507 "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", 3508 "dev": true, 3509 "requires": { 3510 "locate-path": "^5.0.0", 3511 "path-exists": "^4.0.0" 3512 } 3513 }, 3514 "locate-path": { 3515 "version": "5.0.0", 3516 "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", 3517 "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", 3518 "dev": true, 3519 "requires": { 3520 "p-locate": "^4.1.0" 3521 } 3522 }, 3523 "make-dir": { 3524 "version": "3.0.0", 3525 "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", 3526 "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", 3527 "dev": true, 3528 "requires": { 3529 "semver": "^6.0.0" 3530 } 3531 }, 3532 "p-limit": { 3533 "version": "2.2.0", 3534 "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", 3535 "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", 3536 "dev": true, 3537 "requires": { 3538 "p-try": "^2.0.0" 3539 } 3540 }, 3541 "p-locate": { 3542 "version": "4.1.0", 3543 "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", 3544 "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", 3545 "dev": true, 3546 "requires": { 3547 "p-limit": "^2.2.0" 3548 } 3549 }, 3550 "path-exists": { 3551 "version": "4.0.0", 3552 "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 3553 "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 3554 "dev": true 3555 }, 3556 "pkg-dir": { 3557 "version": "4.2.0", 3558 "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", 3559 "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", 3560 "dev": true, 3561 "requires": { 3562 "find-up": "^4.0.0" 3563 } 3564 }, 3565 "semver": { 3566 "version": "6.1.1", 3567 "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", 3568 "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", 3569 "dev": true 3570 } 3571 } 3572 }, 3457 3573 "computed-style": { 3458 3574 "version": "0.1.4", 3459 3575 "resolved": "https://registry.npmjs.org/computed-style/-/computed-style-0.1.4.tgz", … … 3476 3592 "typedarray": "^0.0.6" 3477 3593 } 3478 3594 }, 3595 "concat-with-sourcemaps": { 3596 "version": "1.1.0", 3597 "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", 3598 "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", 3599 "dev": true, 3600 "requires": { 3601 "source-map": "^0.6.1" 3602 }, 3603 "dependencies": { 3604 "source-map": { 3605 "version": "0.6.1", 3606 "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 3607 "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 3608 "dev": true 3609 } 3610 } 3611 }, 3479 3612 "connect-history-api-fallback": { 3480 3613 "version": "1.6.0", 3481 3614 "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", … … 3883 4016 }, 3884 4017 "create-hash": { 3885 4018 "version": "1.2.0", 3886 "resolved": "http s://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",4019 "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", 3887 4020 "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", 3888 4021 "dev": true, 3889 4022 "requires": { … … 3896 4029 }, 3897 4030 "create-hmac": { 3898 4031 "version": "1.1.7", 3899 "resolved": "http s://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",4032 "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", 3900 4033 "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", 3901 4034 "dev": true, 3902 4035 "requires": { … … 3956 4089 }, 3957 4090 "css-color-names": { 3958 4091 "version": "0.0.4", 3959 "resolved": "http s://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",4092 "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", 3960 4093 "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", 3961 4094 "dev": true 3962 4095 }, … … 4593 4726 }, 4594 4727 "diffie-hellman": { 4595 4728 "version": "5.0.3", 4596 "resolved": "http s://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",4729 "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", 4597 4730 "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", 4598 4731 "dev": true, 4599 4732 "requires": { … … 4906 5039 }, 4907 5040 "entities": { 4908 5041 "version": "1.0.0", 4909 "resolved": "http s://registry.npmjs.org/entities/-/entities-1.0.0.tgz",5042 "resolved": "http://registry.npmjs.org/entities/-/entities-1.0.0.tgz", 4910 5043 "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", 4911 5044 "dev": true 4912 5045 }, … … 5341 5474 "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", 5342 5475 "dev": true, 5343 5476 "requires": { 5344 "pend": "~1.2.0" 5477 "pend": "~1.2.0" 5478 } 5479 }, 5480 "yauzl": { 5481 "version": "2.4.1", 5482 "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", 5483 "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", 5484 "dev": true, 5485 "requires": { 5486 "fd-slicer": "~1.0.1" 5487 } 5488 } 5489 } 5490 }, 5491 "extsprintf": { 5492 "version": "1.3.0", 5493 "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 5494 "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", 5495 "dev": true 5496 }, 5497 "fancy-log": { 5498 "version": "1.3.3", 5499 "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", 5500 "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", 5501 "dev": true, 5502 "optional": true, 5503 "requires": { 5504 "ansi-gray": "^0.1.1", 5505 "color-support": "^1.1.3", 5506 "parse-node-version": "^1.0.0", 5507 "time-stamp": "^1.0.0" 5508 } 5509 }, 5510 "fast-average-color": { 5511 "version": "4.3.0", 5512 "resolved": "https://registry.npmjs.org/fast-average-color/-/fast-average-color-4.3.0.tgz", 5513 "integrity": "sha512-k8FXd6+JeXoItmdNqB3hMwFgArryjdYBLuzEM8fRY/oztd/051yhSHU6GUrMOfIQU9dDHyFDcIAkGrQKlYtpDA==" 5514 }, 5515 "fast-deep-equal": { 5516 "version": "2.0.1", 5517 "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 5518 "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", 5519 "dev": true 5520 }, 5521 "fast-glob": { 5522 "version": "2.2.7", 5523 "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", 5524 "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", 5525 "dev": true, 5526 "requires": { 5527 "@mrmlnc/readdir-enhanced": "^2.2.1", 5528 "@nodelib/fs.stat": "^1.1.2", 5529 "glob-parent": "^3.1.0", 5530 "is-glob": "^4.0.0", 5531 "merge2": "^1.2.3", 5532 "micromatch": "^3.1.10" 5533 }, 5534 "dependencies": { 5535 "arr-diff": { 5536 "version": "4.0.0", 5537 "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", 5538 "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", 5539 "dev": true 5540 }, 5541 "array-unique": { 5542 "version": "0.3.2", 5543 "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", 5544 "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", 5545 "dev": true 5546 }, 5547 "braces": { 5548 "version": "2.3.2", 5549 "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", 5550 "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", 5551 "dev": true, 5552 "requires": { 5553 "arr-flatten": "^1.1.0", 5554 "array-unique": "^0.3.2", 5555 "extend-shallow": "^2.0.1", 5556 "fill-range": "^4.0.0", 5557 "isobject": "^3.0.1", 5558 "repeat-element": "^1.1.2", 5559 "snapdragon": "^0.8.1", 5560 "snapdragon-node": "^2.0.1", 5561 "split-string": "^3.0.2", 5562 "to-regex": "^3.0.1" 5563 }, 5564 "dependencies": { 5565 "extend-shallow": { 5566 "version": "2.0.1", 5567 "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 5568 "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 5569 "dev": true, 5570 "requires": { 5571 "is-extendable": "^0.1.0" 5572 } 5573 } 5574 } 5575 }, 5576 "expand-brackets": { 5577 "version": "2.1.4", 5578 "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", 5579 "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", 5580 "dev": true, 5581 "requires": { 5582 "debug": "^2.3.3", 5583 "define-property": "^0.2.5", 5584 "extend-shallow": "^2.0.1", 5585 "posix-character-classes": "^0.1.0", 5586 "regex-not": "^1.0.0", 5587 "snapdragon": "^0.8.1", 5588 "to-regex": "^3.0.1" 5589 }, 5590 "dependencies": { 5591 "define-property": { 5592 "version": "0.2.5", 5593 "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", 5594 "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", 5595 "dev": true, 5596 "requires": { 5597 "is-descriptor": "^0.1.0" 5598 } 5599 }, 5600 "extend-shallow": { 5601 "version": "2.0.1", 5602 "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 5603 "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 5604 "dev": true, 5605 "requires": { 5606 "is-extendable": "^0.1.0" 5607 } 5608 }, 5609 "is-descriptor": { 5610 "version": "0.1.6", 5611 "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", 5612 "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", 5613 "dev": true, 5614 "requires": { 5615 "is-accessor-descriptor": "^0.1.6", 5616 "is-data-descriptor": "^0.1.4", 5617 "kind-of": "^5.0.0" 5618 } 5619 }, 5620 "kind-of": { 5621 "version": "5.1.0", 5622 "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", 5623 "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", 5624 "dev": true 5625 } 5626 } 5627 }, 5628 "extend-shallow": { 5629 "version": "3.0.2", 5630 "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", 5631 "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", 5632 "dev": true, 5633 "requires": { 5634 "assign-symbols": "^1.0.0", 5635 "is-extendable": "^1.0.1" 5636 }, 5637 "dependencies": { 5638 "is-extendable": { 5639 "version": "1.0.1", 5640 "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", 5641 "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", 5642 "dev": true, 5643 "requires": { 5644 "is-plain-object": "^2.0.4" 5645 } 5646 } 5647 } 5648 }, 5649 "extglob": { 5650 "version": "2.0.4", 5651 "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", 5652 "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", 5653 "dev": true, 5654 "requires": { 5655 "array-unique": "^0.3.2", 5656 "define-property": "^1.0.0", 5657 "expand-brackets": "^2.1.4", 5658 "extend-shallow": "^2.0.1", 5659 "fragment-cache": "^0.2.1", 5660 "regex-not": "^1.0.0", 5661 "snapdragon": "^0.8.1", 5662 "to-regex": "^3.0.1" 5663 }, 5664 "dependencies": { 5665 "define-property": { 5666 "version": "1.0.0", 5667 "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", 5668 "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", 5669 "dev": true, 5670 "requires": { 5671 "is-descriptor": "^1.0.0" 5672 } 5673 }, 5674 "extend-shallow": { 5675 "version": "2.0.1", 5676 "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 5677 "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 5678 "dev": true, 5679 "requires": { 5680 "is-extendable": "^0.1.0" 5681 } 5682 } 5683 } 5684 }, 5685 "fill-range": { 5686 "version": "4.0.0", 5687 "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", 5688 "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", 5689 "dev": true, 5690 "requires": { 5691 "extend-shallow": "^2.0.1", 5692 "is-number": "^3.0.0", 5693 "repeat-string": "^1.6.1", 5694 "to-regex-range": "^2.1.0" 5695 }, 5696 "dependencies": { 5697 "extend-shallow": { 5698 "version": "2.0.1", 5699 "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 5700 "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 5701 "dev": true, 5702 "requires": { 5703 "is-extendable": "^0.1.0" 5704 } 5705 } 5706 } 5707 }, 5708 "is-accessor-descriptor": { 5709 "version": "0.1.6", 5710 "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", 5711 "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", 5712 "dev": true, 5713 "requires": { 5714 "kind-of": "^3.0.2" 5715 }, 5716 "dependencies": { 5717 "kind-of": { 5718 "version": "3.2.2", 5719 "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 5720 "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 5721 "dev": true, 5722 "requires": { 5723 "is-buffer": "^1.1.5" 5724 } 5725 } 5726 } 5727 }, 5728 "is-data-descriptor": { 5729 "version": "0.1.4", 5730 "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", 5731 "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", 5732 "dev": true, 5733 "requires": { 5734 "kind-of": "^3.0.2" 5735 }, 5736 "dependencies": { 5737 "kind-of": { 5738 "version": "3.2.2", 5739 "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 5740 "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 5741 "dev": true, 5742 "requires": { 5743 "is-buffer": "^1.1.5" 5744 } 5745 } 5746 } 5747 }, 5748 "is-glob": { 5749 "version": "4.0.1", 5750 "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", 5751 "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", 5752 "dev": true, 5753 "requires": { 5754 "is-extglob": "^2.1.1" 5345 5755 } 5346 5756 }, 5347 " yauzl": {5348 "version": " 2.4.1",5349 "resolved": "https://registry.npmjs.org/ yauzl/-/yauzl-2.4.1.tgz",5350 "integrity": "sha1- lSj0QtqxsihOWLQ3m7GU4i4MQAU=",5757 "is-number": { 5758 "version": "3.0.0", 5759 "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", 5760 "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", 5351 5761 "dev": true, 5352 5762 "requires": { 5353 "fd-slicer": "~1.0.1" 5763 "kind-of": "^3.0.2" 5764 }, 5765 "dependencies": { 5766 "kind-of": { 5767 "version": "3.2.2", 5768 "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 5769 "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 5770 "dev": true, 5771 "requires": { 5772 "is-buffer": "^1.1.5" 5773 } 5774 } 5775 } 5776 }, 5777 "isobject": { 5778 "version": "3.0.1", 5779 "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", 5780 "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", 5781 "dev": true 5782 }, 5783 "kind-of": { 5784 "version": "6.0.2", 5785 "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", 5786 "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", 5787 "dev": true 5788 }, 5789 "micromatch": { 5790 "version": "3.1.10", 5791 "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", 5792 "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", 5793 "dev": true, 5794 "requires": { 5795 "arr-diff": "^4.0.0", 5796 "array-unique": "^0.3.2", 5797 "braces": "^2.3.1", 5798 "define-property": "^2.0.2", 5799 "extend-shallow": "^3.0.2", 5800 "extglob": "^2.0.4", 5801 "fragment-cache": "^0.2.1", 5802 "kind-of": "^6.0.2", 5803 "nanomatch": "^1.2.9", 5804 "object.pick": "^1.3.0", 5805 "regex-not": "^1.0.0", 5806 "snapdragon": "^0.8.1", 5807 "to-regex": "^3.0.2" 5354 5808 } 5355 5809 } 5356 5810 } 5357 5811 }, 5358 "extsprintf": {5359 "version": "1.3.0",5360 "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",5361 "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",5362 "dev": true5363 },5364 "fancy-log": {5365 "version": "1.3.3",5366 "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz",5367 "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==",5368 "dev": true,5369 "optional": true,5370 "requires": {5371 "ansi-gray": "^0.1.1",5372 "color-support": "^1.1.3",5373 "parse-node-version": "^1.0.0",5374 "time-stamp": "^1.0.0"5375 }5376 },5377 "fast-average-color": {5378 "version": "4.3.0",5379 "resolved": "https://registry.npmjs.org/fast-average-color/-/fast-average-color-4.3.0.tgz",5380 "integrity": "sha512-k8FXd6+JeXoItmdNqB3hMwFgArryjdYBLuzEM8fRY/oztd/051yhSHU6GUrMOfIQU9dDHyFDcIAkGrQKlYtpDA=="5381 },5382 "fast-deep-equal": {5383 "version": "2.0.1",5384 "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",5385 "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",5386 "dev": true5387 },5388 5812 "fast-json-stable-stringify": { 5389 5813 "version": "2.0.0", 5390 5814 "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", … … 5416 5840 "dependencies": { 5417 5841 "core-js": { 5418 5842 "version": "1.2.7", 5419 "resolved": "http s://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",5843 "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", 5420 5844 "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" 5421 5845 } 5422 5846 } … … 5501 5925 }, 5502 5926 "finalhandler": { 5503 5927 "version": "1.1.1", 5504 "resolved": "http s://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",5928 "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", 5505 5929 "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", 5506 5930 "dev": true, 5507 5931 "requires": { … … 6525 6949 } 6526 6950 } 6527 6951 }, 6952 "glob-to-regexp": { 6953 "version": "0.3.0", 6954 "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", 6955 "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", 6956 "dev": true 6957 }, 6528 6958 "global-cache": { 6529 6959 "version": "1.2.1", 6530 6960 "resolved": "https://registry.npmjs.org/global-cache/-/global-cache-1.2.1.tgz", … … 6765 7195 "chalk": "^1.1.0" 6766 7196 } 6767 7197 }, 7198 "grunt-concurrent": { 7199 "version": "2.3.1", 7200 "resolved": "https://registry.npmjs.org/grunt-concurrent/-/grunt-concurrent-2.3.1.tgz", 7201 "integrity": "sha1-Hj2zjM71o9oRleYdYx/n4yE0TSM=", 7202 "dev": true, 7203 "requires": { 7204 "arrify": "^1.0.1", 7205 "async": "^1.2.1", 7206 "indent-string": "^2.0.0", 7207 "pad-stream": "^1.0.0" 7208 } 7209 }, 6768 7210 "grunt-contrib-clean": { 6769 7211 "version": "2.0.0", 6770 7212 "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.0.tgz", … … 7140 7582 "dependencies": { 7141 7583 "colors": { 7142 7584 "version": "1.1.2", 7143 "resolved": "http s://registry.npmjs.org/colors/-/colors-1.1.2.tgz",7585 "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", 7144 7586 "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", 7145 7587 "dev": true 7146 7588 } … … 7841 8283 }, 7842 8284 "http-errors": { 7843 8285 "version": "1.6.3", 7844 "resolved": "http s://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",8286 "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 7845 8287 "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", 7846 8288 "dev": true, 7847 8289 "requires": { … … 7870 8312 }, 7871 8313 "http-proxy-middleware": { 7872 8314 "version": "0.18.0", 7873 "resolved": "http s://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz",8315 "resolved": "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz", 7874 8316 "integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==", 7875 8317 "dev": true, 7876 8318 "requires": { … … 10235 10677 }, 10236 10678 "readable-stream": { 10237 10679 "version": "2.3.6", 10238 "resolved": "http s://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",10680 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 10239 10681 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 10240 10682 "dev": true, 10241 10683 "requires": { … … 10250 10692 }, 10251 10693 "string_decoder": { 10252 10694 "version": "1.1.1", 10253 "resolved": "http s://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",10695 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 10254 10696 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 10255 10697 "dev": true, 10256 10698 "requires": { … … 10429 10871 "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", 10430 10872 "dev": true 10431 10873 }, 10874 "n-readlines": { 10875 "version": "1.0.0", 10876 "resolved": "https://registry.npmjs.org/n-readlines/-/n-readlines-1.0.0.tgz", 10877 "integrity": "sha512-ISDqGcspVu6U3VKqtJZG1uR55SmNNF9uK0EMq1IvNVVZOui6MW6VR0+pIZhqz85ORAGp+4zW+5fJ/SE7bwEibA==", 10878 "dev": true 10879 }, 10432 10880 "nan": { 10433 10881 "version": "2.12.1", 10434 10882 "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", … … 11004 11452 }, 11005 11453 "os-locale": { 11006 11454 "version": "1.4.0", 11007 "resolved": "http s://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",11455 "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", 11008 11456 "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", 11009 11457 "dev": true, 11010 11458 "requires": { … … 11099 11547 "integrity": "sha1-0lofmeJQbcsn1nBLg9yooxLk7cw=", 11100 11548 "dev": true 11101 11549 }, 11550 "pad-stream": { 11551 "version": "1.2.0", 11552 "resolved": "https://registry.npmjs.org/pad-stream/-/pad-stream-1.2.0.tgz", 11553 "integrity": "sha1-Yx3Mn3mBC3BZZeid7eps/w/B38k=", 11554 "dev": true, 11555 "requires": { 11556 "meow": "^3.0.0", 11557 "pumpify": "^1.3.3", 11558 "repeating": "^2.0.0", 11559 "split2": "^1.0.0", 11560 "through2": "^2.0.0" 11561 }, 11562 "dependencies": { 11563 "readable-stream": { 11564 "version": "2.3.6", 11565 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 11566 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 11567 "dev": true, 11568 "requires": { 11569 "core-util-is": "~1.0.0", 11570 "inherits": "~2.0.3", 11571 "isarray": "~1.0.0", 11572 "process-nextick-args": "~2.0.0", 11573 "safe-buffer": "~5.1.1", 11574 "string_decoder": "~1.1.1", 11575 "util-deprecate": "~1.0.1" 11576 } 11577 }, 11578 "string_decoder": { 11579 "version": "1.1.1", 11580 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 11581 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 11582 "dev": true, 11583 "requires": { 11584 "safe-buffer": "~5.1.0" 11585 } 11586 }, 11587 "through2": { 11588 "version": "2.0.5", 11589 "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", 11590 "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", 11591 "dev": true, 11592 "requires": { 11593 "readable-stream": "~2.3.6", 11594 "xtend": "~4.0.1" 11595 } 11596 } 11597 } 11598 }, 11102 11599 "pako": { 11103 11600 "version": "1.0.8", 11104 11601 "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", … … 11932 12429 }, 11933 12430 "colors": { 11934 12431 "version": "1.1.2", 11935 "resolved": "http s://registry.npmjs.org/colors/-/colors-1.1.2.tgz",12432 "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", 11936 12433 "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", 11937 12434 "dev": true 11938 12435 }, … … 12330 12827 }, 12331 12828 "react-autosize-textarea": { 12332 12829 "version": "3.0.3", 12333 "resolved": "http s://registry.npmjs.org/react-autosize-textarea/-/react-autosize-textarea-3.0.3.tgz",12830 "resolved": "http://registry.npmjs.org/react-autosize-textarea/-/react-autosize-textarea-3.0.3.tgz", 12334 12831 "integrity": "sha512-iOSZK7RUuJ+iEwkJ9rqYciqtjQgrG1CCRFL6h8Bk61kODnRyEq4tS74IgXpI1t4S6jBBZVm+6ugaU+tWTlVxXg==", 12335 12832 "requires": { 12336 12833 "autosize": "^4.0.0", … … 13692 14189 }, 13693 14190 "sha.js": { 13694 14191 "version": "2.4.11", 13695 "resolved": "http s://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",14192 "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", 13696 14193 "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", 13697 14194 "dev": true, 13698 14195 "requires": { … … 14281 14778 } 14282 14779 } 14283 14780 }, 14781 "split2": { 14782 "version": "1.1.1", 14783 "resolved": "https://registry.npmjs.org/split2/-/split2-1.1.1.tgz", 14784 "integrity": "sha1-Fi2bGIZfAqsvKtlYVSLbm1TEgfk=", 14785 "dev": true, 14786 "requires": { 14787 "through2": "~2.0.0" 14788 }, 14789 "dependencies": { 14790 "readable-stream": { 14791 "version": "2.3.6", 14792 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 14793 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 14794 "dev": true, 14795 "requires": { 14796 "core-util-is": "~1.0.0", 14797 "inherits": "~2.0.3", 14798 "isarray": "~1.0.0", 14799 "process-nextick-args": "~2.0.0", 14800 "safe-buffer": "~5.1.1", 14801 "string_decoder": "~1.1.1", 14802 "util-deprecate": "~1.0.1" 14803 } 14804 }, 14805 "string_decoder": { 14806 "version": "1.1.1", 14807 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 14808 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 14809 "dev": true, 14810 "requires": { 14811 "safe-buffer": "~5.1.0" 14812 } 14813 }, 14814 "through2": { 14815 "version": "2.0.5", 14816 "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", 14817 "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", 14818 "dev": true, 14819 "requires": { 14820 "readable-stream": "~2.3.6", 14821 "xtend": "~4.0.1" 14822 } 14823 } 14824 } 14825 }, 14284 14826 "sprintf-js": { 14285 14827 "version": "1.0.3", 14286 14828 "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", … … 14498 15040 "dependencies": { 14499 15041 "readable-stream": { 14500 15042 "version": "2.3.6", 14501 "resolved": "http s://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",15043 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 14502 15044 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 14503 15045 "dev": true, 14504 15046 "requires": { … … 14513 15055 }, 14514 15056 "string_decoder": { 14515 15057 "version": "1.1.1", 14516 "resolved": "http s://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",15058 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 14517 15059 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 14518 15060 "dev": true, 14519 15061 "requires": { … … 14694 15236 "dependencies": { 14695 15237 "colors": { 14696 15238 "version": "1.1.2", 14697 "resolved": "http s://registry.npmjs.org/colors/-/colors-1.1.2.tgz",15239 "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", 14698 15240 "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", 14699 15241 "dev": true, 14700 15242 "optional": true … … 14862 15404 }, 14863 15405 "through2": { 14864 15406 "version": "0.6.5", 14865 "resolved": "http s://registry.npmjs.org/through2/-/through2-0.6.5.tgz",15407 "resolved": "http://registry.npmjs.org/through2/-/through2-0.6.5.tgz", 14866 15408 "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", 14867 15409 "dev": true, 14868 15410 "optional": true, … … 14880 15422 }, 14881 15423 "readable-stream": { 14882 15424 "version": "1.0.34", 14883 "resolved": "http s://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",15425 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", 14884 15426 "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", 14885 15427 "dev": true, 14886 15428 "optional": true, … … 14893 15435 }, 14894 15436 "string_decoder": { 14895 15437 "version": "0.10.31", 14896 "resolved": "http s://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",15438 "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", 14897 15439 "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", 14898 15440 "dev": true, 14899 15441 "optional": true … … 16195 16737 } 16196 16738 } 16197 16739 }, 16740 "webpack-concat-plugin": { 16741 "version": "3.0.0", 16742 "resolved": "https://registry.npmjs.org/webpack-concat-plugin/-/webpack-concat-plugin-3.0.0.tgz", 16743 "integrity": "sha512-DLdDbZXyrFR99wyAVC9P06HLjr2XujBmQdSbnQMK2o01H9U2NHsN5W76jeTVeXDq5OLvZf8r/se65ftRo3Prow==", 16744 "dev": true, 16745 "requires": { 16746 "concat-with-sourcemaps": "^1.0.5", 16747 "globby": "^8.0.1", 16748 "schema-utils": "^0.4.5", 16749 "uglify-es": "^3.3.9", 16750 "upath": "^1.1.0" 16751 }, 16752 "dependencies": { 16753 "commander": { 16754 "version": "2.13.0", 16755 "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", 16756 "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", 16757 "dev": true 16758 }, 16759 "glob": { 16760 "version": "7.1.4", 16761 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", 16762 "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", 16763 "dev": true, 16764 "requires": { 16765 "fs.realpath": "^1.0.0", 16766 "inflight": "^1.0.4", 16767 "inherits": "2", 16768 "minimatch": "^3.0.4", 16769 "once": "^1.3.0", 16770 "path-is-absolute": "^1.0.0" 16771 } 16772 }, 16773 "globby": { 16774 "version": "8.0.2", 16775 "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz", 16776 "integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==", 16777 "dev": true, 16778 "requires": { 16779 "array-union": "^1.0.1", 16780 "dir-glob": "2.0.0", 16781 "fast-glob": "^2.0.2", 16782 "glob": "^7.1.2", 16783 "ignore": "^3.3.5", 16784 "pify": "^3.0.0", 16785 "slash": "^1.0.0" 16786 } 16787 }, 16788 "pify": { 16789 "version": "3.0.0", 16790 "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", 16791 "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", 16792 "dev": true 16793 }, 16794 "schema-utils": { 16795 "version": "0.4.7", 16796 "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", 16797 "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", 16798 "dev": true, 16799 "requires": { 16800 "ajv": "^6.1.0", 16801 "ajv-keywords": "^3.1.0" 16802 } 16803 }, 16804 "source-map": { 16805 "version": "0.6.1", 16806 "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 16807 "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 16808 "dev": true 16809 }, 16810 "uglify-es": { 16811 "version": "3.3.9", 16812 "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", 16813 "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", 16814 "dev": true, 16815 "requires": { 16816 "commander": "~2.13.0", 16817 "source-map": "~0.6.1" 16818 } 16819 } 16820 } 16821 }, 16198 16822 "webpack-dev-middleware": { 16199 16823 "version": "3.4.0", 16200 16824 "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.4.0.tgz", -
package.json
diff --git a/package.json b/package.json index f1a7f6f7aa..4559b6ae37 100644
a b 17 17 "@wordpress/library-export-default-webpack-plugin": "1.1.0", 18 18 "autoprefixer": "9.4.7", 19 19 "check-node-version": "3.2.0", 20 "compression-webpack-plugin": "3.0.0", 20 21 "copy-webpack-plugin": "^4.6.0", 21 22 "cssnano": "4.1.8", 22 23 "grunt": "~1.0.3", 23 24 "grunt-banner": "^0.6.0", 25 "grunt-concurrent": "2.3.1", 24 26 "grunt-contrib-clean": "~2.0.0", 25 27 "grunt-contrib-concat": "~1.0.0", 26 28 "grunt-contrib-copy": "~1.0.0", … … 44 46 "ink-docstrap": "^1.3.0", 45 47 "jquery-migrate": "1.4.1", 46 48 "matchdep": "~2.0.0", 49 "n-readlines": "1.0.0", 47 50 "node-sass": "~4.12.0", 48 51 "source-map-loader": "^0.2.4", 49 52 "uglify-js": "^3.4.9", 50 53 "uglifyjs-webpack-plugin": "2.1.1", 51 54 "webpack": "4.29.2", 55 "webpack-concat-plugin": "3.0.0", 52 56 "webpack-dev-server": "3.1.14", 53 57 "webpack-livereload-plugin": "2.2.0" 54 58 }, -
src/js/_enqueues/wp/dashboard.js
diff --git a/src/js/_enqueues/wp/dashboard.js b/src/js/_enqueues/wp/dashboard.js index aa9f9218fb..48a7c479d5 100644
a b jQuery(document).ready( function($) { 104 104 if ( el ) { 105 105 el = el.toString(); 106 106 // If the element is available as AJAX widget, show it. 107 if ( $.inArray(el, ajaxWidgets) !== -1 ) {107 if ( $.inArray(el, window.ajaxWidgets) !== -1 ) { 108 108 // Show element without any delay. 109 109 show(0, el); 110 110 } 111 111 } else { 112 112 // Walk through all ajaxWidgets, loading them after each other. 113 $.each( ajaxWidgets, show );113 $.each( window.ajaxWidgets, show ); 114 114 } 115 115 }; 116 116 117 117 // Initially populate ajax widgets. 118 ajaxPopulateWidgets();118 window.ajaxPopulateWidgets(); 119 119 120 120 // Register ajax widgets as postbox toggles. 121 postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );121 postboxes.add_postbox_toggles(pagenow, { pbshow: window.ajaxPopulateWidgets } ); 122 122 123 123 /** 124 124 * Control the Quick Press (Quick Draft) widget. … … jQuery(document).ready( function($) { 149 149 // Replace the form, and prepend the published post. 150 150 $('#dashboard_quick_press .inside').html( data ); 151 151 $('#quick-press').removeClass('initial-form'); 152 quickPressLoad();152 window.quickPressLoad(); 153 153 highlightLatestPost(); 154 154 155 155 // Focus the title to allow for quickly drafting another post. -
src/js/_enqueues/wp/embed.js
diff --git a/src/js/_enqueues/wp/embed.js b/src/js/_enqueues/wp/embed.js index 887c7483fb..689a638793 100644
a b 2 2 * WordPress inline HTML embed 3 3 * 4 4 * @since 4.4.0 5 * @output wp-includes/js/wp-embed.js6 5 * 7 6 * This file cannot have ampersands in it. This is to ensure 8 7 * it can be embedded in older versions of WordPress. 9 8 * See https://core.trac.wordpress.org/changeset/35708. 9 * 10 * For this reason this file also can not be build by 11 * WebPack and has a custom CopyPlugin configuration to build it. 12 * This means that this file can not be watched for changes. 10 13 */ 11 14 (function ( window, document ) { 12 15 'use strict'; -
new file tools/webpack/core.js
diff --git a/tools/webpack/core.js b/tools/webpack/core.js new file mode 100644 index 0000000000..1d27dae47e
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const webpack = require( 'webpack' ); 5 const { join } = require( 'path' ); 6 const UglifyJsPlugin = require( 'uglifyjs-webpack-plugin' ); 7 8 const generateEntries = require( './helpers/generate-entries' ); 9 const copyEmbedPlugin = require( './plugins/copy-embed-plugin' ); 10 const copyNodeModulesPlugin = require( './plugins/copy-node-modules-plugin' ); 11 const copyVendorPlugin = require( './plugins/copy-vendor-plugin' ); 12 const concatTinymcePlugin = require( './plugins/concat-tinymce-plugin' ); 13 const concatEmojiPlugin = require( './plugins/concat-emoji-plugin' ); 14 const compressTinymcePlugin = require( './plugins/compress-tinymce-plugin' ); 15 16 17 module.exports = function( env = { environment: 'production', watch: false, buildTarget: false } ) { 18 const config = { 19 mode: env.environment, 20 cache: true, 21 watch: env.watch, 22 entry: generateEntries( { 23 pattern: './src/js/_enqueues/**/*.js', 24 globOptions: { ignore: './src/js/_enqueues/vendor/**/*.js' }, 25 prefix: './' + env.buildTarget, 26 minify: true 27 } ), 28 output: { 29 filename: '[name]', 30 path: join( __dirname, '../../' ), 31 }, 32 plugins: [ 33 new webpack.optimize.ModuleConcatenationPlugin(), 34 ] 35 }; 36 37 if ( ! env.watch ) { 38 // Most WebPack plugins seem to break WebPack's ability to figure out which input files 39 // relate to which output files. This causes WebPack to rebuild everything on every 40 // change causing extraordinarily long watch times. So we simply don't enable any of these. 41 // This means .min.js files will contain unminified JS and files from the vendor and 42 // node_modules directories aren't ever rebuild while watching. 43 config.optimization = { 44 minimize: true, 45 minimizer: [ 46 new UglifyJsPlugin( { 47 include: /\.min\.js$/, 48 } ) 49 ] 50 }; 51 52 config.plugins.push( 53 copyNodeModulesPlugin, 54 copyVendorPlugin, 55 copyEmbedPlugin, 56 concatTinymcePlugin, 57 concatEmojiPlugin, 58 compressTinymcePlugin 59 ); 60 } 61 62 return config; 63 }; -
new file tools/webpack/helpers/generate-entries.js
diff --git a/tools/webpack/helpers/generate-entries.js b/tools/webpack/helpers/generate-entries.js new file mode 100644 index 0000000000..4179361e01
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const LineReader = require( 'n-readlines' ); 5 const glob = require( 'glob' ); 6 const outputRegex = /@output ([^\s]+)/; 7 8 function getFileOutput( file ) { 9 let line, inComment; 10 const lineReader = new LineReader( file ); 11 12 while ( line = lineReader.next() ) { 13 line = line.toString().trim(); 14 15 // Empty line or opening/closing of comment block. 16 if ( line === '/*' || line === '/**' ) { 17 inComment = true; 18 continue; 19 } 20 if ( line === '*/' ) { 21 inComment = false; 22 continue; 23 } 24 if ( line.length === 0 ) { 25 continue; 26 } 27 28 // Single-line comment or line in comment block. 29 if ( line.startsWith( '/*' ) || ( inComment && line.startsWith( '*' ) ) ) { 30 let output = outputRegex.exec( line ); 31 32 if ( output ) { 33 lineReader.close(); 34 return output[ 1 ]; 35 } 36 37 continue; 38 } 39 40 lineReader.close(); 41 return false; 42 } 43 44 lineReader.close(); 45 return false; 46 } 47 48 module.exports = function( options ) { 49 const entries = {}; 50 const files = glob.sync( options.pattern, options.globOptions ); 51 52 for ( let i = 0; i < files.length; i++ ) { 53 let output, minifiedOutput, file = files[ i ]; 54 55 output = getFileOutput( file ); 56 57 if ( output ) { 58 output = options.prefix + output; 59 if ( ! entries[ output ] ) { 60 entries[output] = []; 61 } 62 entries[ output ].push( file ); 63 64 if ( options.minify ) { 65 minifiedOutput = output.replace( '.js', '.min.js' ); 66 67 if ( ! entries[ minifiedOutput ] ) { 68 entries[minifiedOutput] = []; 69 } 70 entries[ minifiedOutput ].push( file ); 71 } 72 } else { 73 console.warn( `File ${ file } does not contain an @output tag and was ignored.` ); 74 } 75 } 76 77 return entries; 78 }; -
new file tools/webpack/helpers/minifier.js
diff --git a/tools/webpack/helpers/minifier.js b/tools/webpack/helpers/minifier.js new file mode 100644 index 0000000000..3925b22574
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const UglifyJS = require( 'uglify-js' ); 5 6 module.exports = function ( options ) { 7 options = options || {}; 8 options.output = Object.assign( {}, options.output, { 9 ascii_only: true, 10 ie8: true 11 } ); 12 13 return function ( contents ) { 14 const minified = UglifyJS.minify( contents.toString(), options ); 15 16 if ( minified.error ) { 17 console.error( minified.error ); 18 } 19 20 return minified.code.toString(); 21 }; 22 }; -
deleted file tools/webpack/media.js
diff --git a/tools/webpack/media.js b/tools/webpack/media.js deleted file mode 100644 index 8f55c32249..0000000000
+ - 1 const UglifyJsPlugin = require( 'uglifyjs-webpack-plugin' );2 3 var path = require( 'path' ),4 admin_files = {};5 6 const baseDir = path.join( __dirname, '../../' );7 8 module.exports = function( env = { environment: 'production', watch: false, buildTarget: false } ) {9 const include_files = {10 [ env.buildTarget + 'wp-includes/js/media-audiovideo.js' ]: ['./src/js/_enqueues/wp/media/audiovideo.js'],11 [ env.buildTarget + 'wp-includes/js/media-audiovideo.min.js' ]: ['./src/js/_enqueues/wp/media/audiovideo.js'],12 [ env.buildTarget + 'wp-includes/js/media-grid.js' ]: ['./src/js/_enqueues/wp/media/grid.js'],13 [ env.buildTarget + 'wp-includes/js/media-grid.min.js' ]: ['./src/js/_enqueues/wp/media/grid.js'],14 [ env.buildTarget + 'wp-includes/js/media-models.js' ]: ['./src/js/_enqueues/wp/media/models.js'],15 [ env.buildTarget + 'wp-includes/js/media-models.min.js' ]: ['./src/js/_enqueues/wp/media/models.js'],16 [ env.buildTarget + 'wp-includes/js/media-views.js' ]: ['./src/js/_enqueues/wp/media/views.js'],17 [ env.buildTarget + 'wp-includes/js/media-views.min.js' ]: ['./src/js/_enqueues/wp/media/views.js'],18 };19 20 const mediaConfig = {21 mode: "production",22 cache: true,23 entry: Object.assign( admin_files, include_files ),24 output: {25 path: baseDir,26 filename: '[name]',27 },28 optimization: {29 minimize: true,30 minimizer: [31 new UglifyJsPlugin( {32 include: /\.min\.js$/,33 } )34 ]35 },36 watch: env.watch,37 };38 39 return mediaConfig;40 }; -
new file tools/webpack/plugins/compress-tinymce-plugin.js
diff --git a/tools/webpack/plugins/compress-tinymce-plugin.js b/tools/webpack/plugins/compress-tinymce-plugin.js new file mode 100644 index 0000000000..25f6e667a0
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const CompressionPlugin = require("compression-webpack-plugin"); 5 6 module.exports = new CompressionPlugin({ 7 include: './build/wp-includes/js/tinymce/wp-tinymce.js' 8 }); -
new file tools/webpack/plugins/concat-emoji-plugin.js
diff --git a/tools/webpack/plugins/concat-emoji-plugin.js b/tools/webpack/plugins/concat-emoji-plugin.js new file mode 100644 index 0000000000..fd44a9266b
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const ConcatPlugin = require('webpack-concat-plugin'); 5 6 module.exports = new ConcatPlugin( { 7 filesToConcat: [ 8 './node_modules/twemoji/2/twemoji.js', 9 './src/js/_enqueues/wp/emoji.js' 10 ], 11 outputPath: './build/wp-includes/js/', 12 fileName: 'wp-emoji-release.min.js' 13 } ); -
new file tools/webpack/plugins/concat-tinymce-plugin.js
diff --git a/tools/webpack/plugins/concat-tinymce-plugin.js b/tools/webpack/plugins/concat-tinymce-plugin.js new file mode 100644 index 0000000000..481b1f9470
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const ConcatPlugin = require('webpack-concat-plugin'); 5 6 module.exports = new ConcatPlugin({ 7 filesToConcat: [ 8 './src/js/_enqueues/vendor/tinymce/tinymce.min.js', 9 './src/js/_enqueues/vendor/tinymce/themes/modern/theme.min.js', 10 './src/js/_enqueues/vendor/tinymce/plugins/**/plugin.min.js' 11 ], 12 outputPath: './build/wp-includes/js/tinymce/', 13 fileName: 'wp-tinymce.js' 14 }); -
new file tools/webpack/plugins/copy-embed-plugin.js
diff --git a/tools/webpack/plugins/copy-embed-plugin.js b/tools/webpack/plugins/copy-embed-plugin.js new file mode 100644 index 0000000000..b979d40d70
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const CopyPlugin = require( 'copy-webpack-plugin' ); 5 const minifier = require( '../helpers/minifier' ); 6 7 module.exports = new CopyPlugin([ 8 { 9 from: './src/js/_enqueues/wp/embed.js', 10 to: './build/wp-includes/js/wp-embed.js' 11 }, 12 { 13 from: './src/js/_enqueues/wp/embed.js', 14 to: './build/wp-includes/js/wp-embed.min.js', 15 transform: minifier( { compress: { conditionals: false } } ) 16 } 17 ]); -
new file tools/webpack/plugins/copy-node-modules-plugin.js
diff --git a/tools/webpack/plugins/copy-node-modules-plugin.js b/tools/webpack/plugins/copy-node-modules-plugin.js new file mode 100644 index 0000000000..3f547d70fd
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const CopyPlugin = require('copy-webpack-plugin'); 5 const minifier = require( '../helpers/minifier' ); 6 7 module.exports = new CopyPlugin([ 8 { to: './build/wp-includes/js/backbone.js', from: './node_modules/backbone/backbone.js' }, 9 { to: './build/wp-includes/js/backbone.min.js', from: './node_modules/backbone/backbone-min.js' }, 10 { to: './build/wp-includes/js/hoverIntent.js', from: './node_modules/jquery-hoverintent/jquery.hoverIntent.js' }, 11 { 12 to: './build/wp-includes/js/hoverIntent.min.js', 13 from: './node_modules/jquery-hoverintent/jquery.hoverIntent.js', 14 transform: minifier() 15 }, 16 { to: './build/wp-includes/js/imagesloaded.min.js', from: './node_modules/imagesloaded/imagesloaded.pkgd.min.js' }, 17 { to: './build/wp-includes/js/jquery/jquery-migrate.js', from: './node_modules/jquery-migrate/dist/jquery-migrate.js' }, 18 { to: './build/wp-includes/js/jquery/jquery-migrate.min.js', from: './node_modules/jquery-migrate/dist/jquery-migrate.min.js' }, 19 { to: './build/wp-includes/js/jquery/jquery.form.js', from: './node_modules/jquery-form/src/jquery.form.js' }, 20 { to: './build/wp-includes/js/jquery/jquery.form.min.js', from: './node_modules/jquery-form/dist/jquery.form.min.js' }, 21 { to: './build/wp-includes/js/masonry.min.js', from: './node_modules/masonry-layout/dist/masonry.pkgd.min.js' }, 22 { to: './build/wp-includes/js/underscore.min.js', from: './node_modules/underscore/underscore-min.js' }, 23 { to: './build/wp-includes/js/twemoji.js', from: './node_modules/twemoji/2/twemoji.js' }, 24 { to: './build/wp-includes/js/twemoji.min.js', from: './node_modules/twemoji/2/twemoji.min.js' }, 25 { 26 to: './build/wp-includes/js/jquery/jquery.js', 27 from: './node_modules/jquery/dist/jquery.min.js', 28 transform: function ( contents ) { 29 return contents.toString() + '\njQuery.noConflict();'; 30 } 31 }, 32 { 33 from: '*.js', 34 context: './node_modules/jquery-ui/ui/', 35 to: './build/wp-includes/js/jquery/ui/[name].min.js', 36 toType: 'template', 37 transform: minifier( { output: { comments: /^!/ } } ) 38 } 39 ]); -
new file tools/webpack/plugins/copy-vendor-plugin.js
diff --git a/tools/webpack/plugins/copy-vendor-plugin.js b/tools/webpack/plugins/copy-vendor-plugin.js new file mode 100644 index 0000000000..d5fc6c6bc0
- + 1 /* jshint node:true */ 2 /* jshint esversion:6 */ 3 4 const CopyPlugin = require('copy-webpack-plugin'); 5 6 const minifier = require( '../helpers/minifier' ); 7 8 module.exports = new CopyPlugin([ 9 { 10 from: '**/*', 11 context: './src/js/_enqueues/vendor/', 12 ignore: [ 13 'farbtastic.js', 14 'iris.min.js', 15 'deprecated/**', 16 'README.md', 17 // Ignore unminified version of vendor lib we don't ship. 18 'jquery/jquery.masonry.js', 19 'tinymce/tinymce.js' 20 ], 21 to: './build/wp-includes/js/' 22 }, 23 { 24 from: '{farbtastic,iris.min}.js', 25 context: './src/js/_enqueues/vendor/', 26 to: './build/wp-admin/js/' 27 }, 28 { 29 from: 'suggest*', 30 context: './src/js/_enqueues/vendor/deprecated', 31 to: 'build/wp-includes/js/jquery/' 32 }, 33 { 34 from: './src/js/_enqueues/vendor/imgareaselect/jquery.imgareaselect.js', 35 to: './build/wp-includes/js/imgareaselect/jquery.imgareaselect.min.js', 36 transform: minifier() 37 }, 38 { 39 from: './src/js/_enqueues/vendor/colorpicker.js', 40 to: './build/wp-includes/js/colorpicker.min.js', 41 transform: minifier() 42 }, 43 { 44 from: './src/js/_enqueues/vendor/json2.js', 45 to: './build/wp-includes/js/json2.min.js', 46 transform: minifier() 47 }, 48 { 49 from: './src/js/_enqueues/vendor/mediaelement/mediaelement-migrate.js', 50 to: './build/wp-includes/js/mediaelement/mediaelement-migrate.min.js', 51 transform: minifier() 52 }, 53 { 54 from: './src/js/_enqueues/vendor/mediaelement/wp-mediaelement.js', 55 to: './build/wp-includes/js/mediaelement/wp-mediaelement.min.js', 56 transform: minifier() 57 }, 58 { 59 from: './src/js/_enqueues/vendor/mediaelement/wp-playlist.js', 60 to: './build/wp-includes/js/mediaelement/wp-playlist.min.js', 61 transform: minifier() 62 }, 63 { 64 from: '*.js', 65 context: './src/js/_enqueues/vendor/plupload/', 66 to: './build/wp-includes/js/plupload/[name].min.js', 67 toType: 'template', 68 transform: minifier() 69 }, 70 { 71 from: '{wordpress,wp*}/plugin.js', 72 context: './src/js/_enqueues/vendor/tinymce/plugins/', 73 to: './build/wp-includes/js/tinymce/plugins/[path]plugin.min.js', 74 toType: 'template', 75 transform: minifier() 76 }, 77 { 78 from: './src/js/_enqueues/vendor/tw-sack.js', 79 to: './build/wp-includes/js/tw-sack.min.js', 80 transform: minifier() 81 } 82 ]); -
webpack.config.js
diff --git a/webpack.config.js b/webpack.config.js index bc6ab59bee..7ed04a38f0 100644
a b 1 const mediaConfig = require( './tools/webpack/media' );1 const coreConfig = require( './tools/webpack/core' ); 2 2 const packagesConfig = require( './tools/webpack/packages' ); 3 3 4 4 module.exports = function( env = { environment: "production", watch: false, buildTarget: false } ) { … … module.exports = function( env = { environment: "production", watch: false, buil 11 11 } 12 12 13 13 const config = [ 14 mediaConfig( env ),14 coreConfig( env ), 15 15 packagesConfig( env ), 16 16 ]; 17 17