Changeset 54308
- Timestamp:
- 09/26/2022 11:40:44 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/webpack/blocks.js
r54307 r54308 14 14 */ 15 15 const { normalizeJoin, stylesTransform, baseConfig, baseDir } = require( './shared' ); 16 const { 17 isDynamic, 18 toDirectoryName, 19 getStableBlocksMetadata, 20 } = require( '../release/sync-stable-blocks' ); 16 21 17 22 module.exports = function( env = { environment: 'production', watch: false, buildTarget: false } ) { … … 19 24 const suffix = mode === 'production' ? '.min' : ''; 20 25 let buildTarget = env.buildTarget ? env.buildTarget : ( mode === 'production' ? 'build' : 'src' ); 21 buildTarget = buildTarget 26 buildTarget = buildTarget + '/wp-includes'; 22 27 23 const dynamicBlockFolders = [ 24 'archives', 25 'avatar', 26 'block', 27 'calendar', 28 'categories', 29 'comment-author-name', 30 'comment-content', 31 'comment-date', 32 'comment-edit-link', 33 'comment-reply-link', 34 'comment-template', 35 'comments', 36 'comments-pagination', 37 'comments-pagination-next', 38 'comments-pagination-numbers', 39 'comments-pagination-previous', 40 'comments-title', 41 'cover', 42 'file', 43 'gallery', 44 'home-link', 45 'image', 46 'latest-comments', 47 'latest-posts', 48 'loginout', 49 'navigation', 50 'navigation-link', 51 'navigation-submenu', 52 'page-list', 53 'pattern', 54 'post-author', 55 'post-author-biography', 56 'post-comments-form', 57 'post-content', 58 'post-date', 59 'post-excerpt', 60 'post-featured-image', 61 'post-navigation-link', 62 'post-template', 63 'post-terms', 64 'post-title', 65 'query', 66 'query-no-results', 67 'query-pagination', 68 'query-pagination-next', 69 'query-pagination-numbers', 70 'query-pagination-previous', 71 'query-title', 72 'read-more', 73 'rss', 74 'search', 75 'shortcode', 76 'site-logo', 77 'site-tagline', 78 'site-title', 79 'social-link', 80 'tag-cloud', 81 'template-part', 82 'term-description', 83 ]; 84 const blockFolders = [ 85 'audio', 86 'button', 87 'buttons', 88 'code', 89 'column', 90 'columns', 91 'embed', 92 'freeform', 93 'group', 94 'heading', 95 'html', 96 'list', 97 'list-item', 98 'media-text', 99 'missing', 100 'more', 101 'nextpage', 102 'paragraph', 103 'preformatted', 104 'pullquote', 105 'quote', 106 'separator', 107 'social-links', 108 'spacer', 109 'table', 110 'text-columns', 111 'verse', 112 'video', 113 ...dynamicBlockFolders, 114 ]; 28 const blocks = getStableBlocksMetadata(); 29 const dynamicBlockFolders = blocks.filter( isDynamic ).map( toDirectoryName ); 30 const blockFolders = blocks.map( toDirectoryName ); 115 31 const blockPHPFiles = { 116 32 'widgets/src/blocks/legacy-widget/index.php': 'wp-includes/blocks/legacy-widget.php', … … 119 35 files[ `block-library/src/${ blockName }/index.php` ] = `wp-includes/blocks/${ blockName }.php`; 120 36 return files; 121 } 37 }, {} ), 122 38 }; 123 39 const blockMetadataFiles = { … … 127 43 files[ `block-library/src/${ blockName }/block.json` ] = `wp-includes/blocks/${ blockName }/block.json`; 128 44 return files; 129 } 45 }, {} ), 130 46 }; 131 47 … … 164 80 'process.env.IS_GUTENBERG_PLUGIN': false, 165 81 'process.env.FORCE_REDUCED_MOTION': JSON.stringify( 166 process.env.FORCE_REDUCED_MOTION 82 process.env.FORCE_REDUCED_MOTION, 167 83 ), 168 84 } ),
Note: See TracChangeset
for help on using the changeset viewer.