saleor-dashboard/babel.config.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-08-27 09:35:54 +00:00
module.exports = api => {
2019-11-05 14:39:37 +00:00
const isExtract = api.env("extract");
2019-08-27 09:35:54 +00:00
const isTest = api.env("test");
2019-08-27 11:02:47 +00:00
const isStorybook = api.env("storybook");
2019-08-27 09:35:54 +00:00
2019-08-27 11:02:47 +00:00
const ignore =
isTest || isStorybook
? []
: ["**/*.test.ts", "**/*.test.tsx", "src/storybook"];
2019-08-27 09:35:54 +00:00
2019-08-27 11:02:47 +00:00
const presets = [
[
"@babel/preset-env",
{
corejs: "3.2.1",
modules: isTest ? "auto" : false,
useBuiltIns: "usage"
}
2019-08-27 09:35:54 +00:00
],
2019-08-27 11:02:47 +00:00
"@babel/preset-react",
"@babel/preset-typescript"
];
const plugins = [
"@babel/plugin-proposal-numeric-separator",
2020-02-20 14:18:22 +00:00
"@babel/plugin-proposal-optional-chaining",
2019-08-27 11:02:47 +00:00
"@babel/plugin-proposal-class-properties",
[
"@babel/plugin-proposal-decorators",
{
decoratorsBeforeExport: true
}
2019-08-27 09:35:54 +00:00
],
2019-08-27 11:02:47 +00:00
"@babel/plugin-proposal-object-rest-spread",
Refunds (#870) * 1721 - add refunds miscellaneous view (#860) * Create new page for Miscellaneous Refunds * Replace refund order dialog with dedicated page * Add data test ids * Update order details view for refunds (#874) * 1719 - add refund entry to order history (#875) * Add refund order history entry * Update refund event with the right query * 1722 - add refunds product view (#873) * Create new page for Miscellaneous Refunds * Replace refund order dialog with dedicated page * Add data test ids * Create refund products table * Implement refund products view * Update refund mutation with product lines input * Fix products quantities on refund page * Fix order refund submission * Fix products refund submission input variables * Filter out fulfillments on refund page * Update refund page in storybook * Fix test snapshots after wrong refunds rebase * Set max refund as captured amount * Refund queries adjustments * Display refund values with nullish coalescing operator * Update test snapshots with refunds * Refactor order refund values calculation * Create and use refund order line fragment * Use old simple refund mutation for miscellaneous refund * Submit for refund only lines with non-zero quantity set * Fix showing refund error * Fix refund details on order details page (#879) * Update order details view for refunds (#874) * 1719 - add refund entry to order history (#875) * Add refund order history entry * Update refund event with the right query * 1722 - add refunds product view (#873) * Create new page for Miscellaneous Refunds * Replace refund order dialog with dedicated page * Add data test ids * Create refund products table * Implement refund products view * Update refund mutation with product lines input * Fix products quantities on refund page * Fix order refund submission * Fix products refund submission input variables * Filter out fulfillments on refund page * Update refund page in storybook * Fix test snapshots after wrong refunds rebase * Set max refund as captured amount * Refund queries adjustments * Display refund values with nullish coalescing operator * Update test snapshots with refunds * Refactor order refund values calculation * Create and use refund order line fragment * Use old simple refund mutation for miscellaneous refund * Submit for refund only lines with non-zero quantity set * Fix showing refund error * Add missing refund amount to order history * Merge repeated order lines in fulfillment lines * Update order history events types and test snapshots * Update changelog with refunds changes
2020-12-01 13:13:05 +00:00
"@babel/plugin-proposal-nullish-coalescing-operator",
2019-11-05 14:39:37 +00:00
"react-intl-auto"
];
if (isExtract) {
plugins.push([
2019-08-27 11:02:47 +00:00
"react-intl",
{
extractFromFormatMessageCall: true,
messagesDir: "build/locale/"
}
2019-11-05 14:39:37 +00:00
]);
}
plugins.push("macros");
2019-08-27 11:02:47 +00:00
return {
ignore,
2019-08-27 11:02:47 +00:00
plugins,
2020-02-20 14:18:22 +00:00
presets
2019-08-27 09:35:54 +00:00
};
};