diff --git a/babel.config.js b/babel.config.js index 9ebdb1c97..723c15517 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,42 +1,48 @@ module.exports = api => { const isTest = api.env("test"); + const isStorybook = api.env("storybook"); - const ignore = isTest - ? [] - : ["**/*.test.ts", "**/*.test.tsx", "src/storybook"]; + const ignore = + isTest || isStorybook + ? [] + : ["**/*.test.ts", "**/*.test.tsx", "src/storybook"]; + + const presets = [ + [ + "@babel/preset-env", + { + corejs: "3.2.1", + modules: isTest ? "auto" : false, + useBuiltIns: "usage" + } + ], + "@babel/preset-react", + "@babel/preset-typescript" + ]; + + const plugins = [ + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-class-properties", + [ + "@babel/plugin-proposal-decorators", + { + decoratorsBeforeExport: true + } + ], + "@babel/plugin-proposal-object-rest-spread", + "react-intl-auto", + [ + "react-intl", + { + extractFromFormatMessageCall: true, + messagesDir: "build/locale/" + } + ] + ]; return { - presets: [ - [ - "@babel/preset-env", - { - corejs: "3.2.1", - modules: isTest ? "auto" : false, - useBuiltIns: "usage" - } - ], - "@babel/preset-react", - "@babel/preset-typescript" - ], - plugins: [ - "@babel/plugin-proposal-numeric-separator", - "@babel/plugin-proposal-class-properties", - [ - "@babel/plugin-proposal-decorators", - { - decoratorsBeforeExport: true - } - ], - "@babel/plugin-proposal-object-rest-spread", - "react-intl-auto", - [ - "react-intl", - { - extractFromFormatMessageCall: true, - messagesDir: "build/locale/" - } - ] - ], + presets, + plugins, ignore }; }; diff --git a/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx b/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx index cf63c5597..f87dc12c7 100644 --- a/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx +++ b/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx @@ -70,7 +70,7 @@ const HomeNotificationTable = withStyles(styles, { } are ready to fulfill" id="homeNotificationTableOrders" values={{ - amount: ordersToFulfill + amount: {ordersToFulfill} }} /> @@ -100,7 +100,7 @@ const HomeNotificationTable = withStyles(styles, { } to capture" id="homeNotificationTablePayments" values={{ - amount: ordersToCapture + amount: {ordersToCapture} }} /> @@ -130,7 +130,7 @@ const HomeNotificationTable = withStyles(styles, { } out of stock" id="homeNotificationTableProducts" values={{ - amount: productsOutOfStock + amount: {productsOutOfStock} }} /> diff --git a/src/storybook/webpack.config.js b/src/storybook/webpack.config.js index 1e2cdb04b..9c94ff6cb 100644 --- a/src/storybook/webpack.config.js +++ b/src/storybook/webpack.config.js @@ -1,15 +1,18 @@ /* eslint-disable */ +const path = require("path"); const CheckerPlugin = require("fork-ts-checker-webpack-plugin"); const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); +const resolve = resolvePath => path.resolve(__dirname, resolvePath); + module.exports = ({ config }) => { config.module.rules.push({ - test: /\.tsx?$/, + test: /\.(jsx?|tsx?)$/, exclude: /node_modules/, - loader: "ts-loader", + loader: "babel-loader", options: { - experimentalWatchApi: true, - transpileOnly: true + configFile: resolve("../../babel.config.js"), + envName: "storybook" } }); config.optimization.removeAvailableModules = false; diff --git a/webpack.config.js b/webpack.config.js index b400fd3b0..9ba890630 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -69,7 +69,10 @@ module.exports = (env, argv) => { { test: /\.(jsx?|tsx?)$/, exclude: /node_modules/, - loader: "babel-loader" + loader: "babel-loader", + options: { + configFile: resolve("./babel.config.js") + } }, { test: /\.(eot|otf|png|svg|jpg|ttf|woff|woff2)(\?v=[0-9.]+)?$/,