35 lines
638 B
JavaScript
35 lines
638 B
JavaScript
|
module.exports = function( api ) {
|
||
|
api.cache( true );
|
||
|
|
||
|
return {
|
||
|
presets: [ '@wordpress/babel-preset-default' ],
|
||
|
plugins: [
|
||
|
'@babel/plugin-transform-async-to-generator',
|
||
|
'transform-class-properties',
|
||
|
[ '@babel/transform-react-jsx', {
|
||
|
pragma: 'createElement',
|
||
|
} ],
|
||
|
[
|
||
|
'@wordpress/babel-plugin-import-jsx-pragma',
|
||
|
{
|
||
|
scopeVariable: 'createElement',
|
||
|
source: '@wordpress/element',
|
||
|
isDefault: false,
|
||
|
},
|
||
|
],
|
||
|
],
|
||
|
env: {
|
||
|
production: {
|
||
|
plugins: [
|
||
|
[
|
||
|
'@wordpress/babel-plugin-makepot',
|
||
|
{
|
||
|
output: 'languages/wc-admin.pot',
|
||
|
},
|
||
|
],
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
};
|