Fix storybook config
This commit is contained in:
parent
cb16d68060
commit
1e4ecc7e6e
4 changed files with 54 additions and 42 deletions
|
@ -1,12 +1,13 @@
|
||||||
module.exports = api => {
|
module.exports = api => {
|
||||||
const isTest = api.env("test");
|
const isTest = api.env("test");
|
||||||
|
const isStorybook = api.env("storybook");
|
||||||
|
|
||||||
const ignore = isTest
|
const ignore =
|
||||||
|
isTest || isStorybook
|
||||||
? []
|
? []
|
||||||
: ["**/*.test.ts", "**/*.test.tsx", "src/storybook"];
|
: ["**/*.test.ts", "**/*.test.tsx", "src/storybook"];
|
||||||
|
|
||||||
return {
|
const presets = [
|
||||||
presets: [
|
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
|
@ -17,8 +18,9 @@ module.exports = api => {
|
||||||
],
|
],
|
||||||
"@babel/preset-react",
|
"@babel/preset-react",
|
||||||
"@babel/preset-typescript"
|
"@babel/preset-typescript"
|
||||||
],
|
];
|
||||||
plugins: [
|
|
||||||
|
const plugins = [
|
||||||
"@babel/plugin-proposal-numeric-separator",
|
"@babel/plugin-proposal-numeric-separator",
|
||||||
"@babel/plugin-proposal-class-properties",
|
"@babel/plugin-proposal-class-properties",
|
||||||
[
|
[
|
||||||
|
@ -36,7 +38,11 @@ module.exports = api => {
|
||||||
messagesDir: "build/locale/"
|
messagesDir: "build/locale/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets,
|
||||||
|
plugins,
|
||||||
ignore
|
ignore
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -70,7 +70,7 @@ const HomeNotificationTable = withStyles(styles, {
|
||||||
} are ready to fulfill"
|
} are ready to fulfill"
|
||||||
id="homeNotificationTableOrders"
|
id="homeNotificationTableOrders"
|
||||||
values={{
|
values={{
|
||||||
amount: ordersToFulfill
|
amount: <strong>{ordersToFulfill}</strong>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
@ -100,7 +100,7 @@ const HomeNotificationTable = withStyles(styles, {
|
||||||
} to capture"
|
} to capture"
|
||||||
id="homeNotificationTablePayments"
|
id="homeNotificationTablePayments"
|
||||||
values={{
|
values={{
|
||||||
amount: ordersToCapture
|
amount: <strong>{ordersToCapture}</strong>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
@ -130,7 +130,7 @@ const HomeNotificationTable = withStyles(styles, {
|
||||||
} out of stock"
|
} out of stock"
|
||||||
id="homeNotificationTableProducts"
|
id="homeNotificationTableProducts"
|
||||||
values={{
|
values={{
|
||||||
amount: productsOutOfStock
|
amount: <strong>{productsOutOfStock}</strong>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
const path = require("path");
|
||||||
const CheckerPlugin = require("fork-ts-checker-webpack-plugin");
|
const CheckerPlugin = require("fork-ts-checker-webpack-plugin");
|
||||||
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
|
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
|
||||||
|
|
||||||
|
const resolve = resolvePath => path.resolve(__dirname, resolvePath);
|
||||||
|
|
||||||
module.exports = ({ config }) => {
|
module.exports = ({ config }) => {
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.tsx?$/,
|
test: /\.(jsx?|tsx?)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: "ts-loader",
|
loader: "babel-loader",
|
||||||
options: {
|
options: {
|
||||||
experimentalWatchApi: true,
|
configFile: resolve("../../babel.config.js"),
|
||||||
transpileOnly: true
|
envName: "storybook"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
config.optimization.removeAvailableModules = false;
|
config.optimization.removeAvailableModules = false;
|
||||||
|
|
|
@ -69,7 +69,10 @@ module.exports = (env, argv) => {
|
||||||
{
|
{
|
||||||
test: /\.(jsx?|tsx?)$/,
|
test: /\.(jsx?|tsx?)$/,
|
||||||
exclude: /node_modules/,
|
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.]+)?$/,
|
test: /\.(eot|otf|png|svg|jpg|ttf|woff|woff2)(\?v=[0-9.]+)?$/,
|
||||||
|
|
Loading…
Reference in a new issue