Skip to content

Instantly share code, notes, and snippets.

@Shelob9 Shelob9/.babelrc
Last active Jun 27, 2018

Embed
What would you like to do?
{
"presets": [ "@wordpress/default" ]
}
{
"jest": {
"collectCoverageFrom": [
"clients/**/*.js"
],
"coverageThreshold": {
"global": {
"statements": 90,
"branches": 90,
"functions": 90,
"lines": 90
}
},
"automock": false,
"setupFiles": [
"./clients/tests/setupJest.js"
]
}
}
global.wp = {
shortcode: {
},
apiRequest: {
}
};
Object.defineProperty( global.wp, 'element', {
get: () => require( 'React' ),
} );
// Define WordPress dependencies
const wpDependencies = [ 'components', 'element', 'blocks', 'utils', 'date' ];
// Setup externals for all WordPress dependencies
wpDependencies.forEach( wpDependency => {
externals[ '@wordpress/' + wpDependency ] = {
this: [ 'wp', wpDependency ]
};
});
import React from 'react';
Object.defineProperty( global.wp, 'element', {
get: () => React
} );
//The rest of the code...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.