-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
326 changed files
with
23,078 additions
and
23,862 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ composer.lock | |
## keep compiled files out of version control | ||
# dist/ | ||
.phpunit.result.cache | ||
.npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const WPDependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' ); | ||
|
||
class DependencyExtractionWebpackPlugin extends WPDependencyExtractionWebpackPlugin { | ||
/** | ||
* Extend the default stringify behavior to sort dependencies by name before returning them. | ||
* | ||
* @param {any} asset Asset Data | ||
* @return {string} Stringified asset data suitable for output | ||
*/ | ||
stringify( asset ) { | ||
const prefix = 'generateblocks-'; | ||
const sortedDeps = asset.dependencies.sort( ( a, b ) => { | ||
const aMatches = a.startsWith( prefix ); | ||
const bMatches = b.startsWith( prefix ); | ||
|
||
if ( aMatches && ! bMatches ) { | ||
return 1; | ||
} | ||
if ( bMatches && ! aMatches ) { | ||
return -1; | ||
} | ||
|
||
return a.localeCompare( b ); | ||
} ); | ||
|
||
const updatedAsset = { ...asset, dependencies: sortedDeps }; | ||
|
||
// Fallback to the original method with the updated asset. | ||
return super.stringify( updatedAsset ); | ||
} | ||
} | ||
|
||
module.exports = DependencyExtractionWebpackPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'efa82fe89c6f1a14f7be'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php return array('dependencies' => array(), 'version' => 'a4522fa7e290a23cd862'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.