* Use babel to compile debug package (https://github.com/woocommerce/woocommerce-admin/pull/5987)

* replace [].flat() with written js

Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
This commit is contained in:
Paul Sealock 2021-01-14 10:01:35 +13:00 committed by GitHub
parent 1a45ae2c0d
commit 6b0c5ecda1
3 changed files with 15 additions and 10 deletions

View File

@ -1,15 +1,18 @@
const { babelConfig: e2eBabelConfig } = require( '@woocommerce/e2e-environment' );
const {
babelConfig: e2eBabelConfig,
} = require( '@woocommerce/e2e-environment' );
module.exports = function( api ) {
module.exports = function ( api ) {
api.cache( true );
return {
...e2eBabelConfig,
presets: [
...e2eBabelConfig.presets,
'@wordpress/babel-preset-default',
],
plugins: [
...e2eBabelConfig,
presets: [
...e2eBabelConfig.presets,
'@wordpress/babel-preset-default',
],
sourceType: 'unambiguous',
plugins: [
/**
* This allows arrow functions as class methods so that binding
* methods to `this` in the constructor isn't required.

View File

@ -51,7 +51,9 @@ export class TaskList extends Component {
getUngroupedTasks() {
const { tasks: groupedTasks } = this.props;
return Object.values( groupedTasks ).flat();
return Object.values( groupedTasks ).reduce( ( acc, task ) => {
return acc.concat( task );
}, [] );
}
getSpecificTasks() {

View File

@ -117,7 +117,7 @@ const webpackConfig = {
},
{
test: /\.js?$/,
exclude: /node_modules/,
exclude: /node_modules(\/|\\)(?!(debug))/,
use: {
loader: 'babel-loader',
options: {