saleor-dashboard/src/storybook/webpack.config.js
Dominik Żegleń 7d9441a7ec
Use esbuild-loader (#1983)
* Minor fixes for intl messages

* Add esbuild-loader
* switch from babel to esbuild-loader
* use formatjs enforce-id linter

* Generate ids for intl messages

* id format defined by idInterpolationPattern

* Modify intl messages extraction

* remove react-intl-translations-manager
* remove transpile-tx.js
* use formatjs cli

* Modify defaultMessages.json

* modify ids in defaultMessages.json with defined idInterpolationPattern

* Fix errors

* Fix page crash

* Use babel to transpile tests

* Fix useStateFromProps

* Improve render count

* Add test to useStateFromProps

* Fix reloading state buh

* Do not check if form with channels is dirty

* Stop blocking save if form has not changed

* Remove debug code

* Fix form disabling

* Fix variant selection checkbox onClick

* Update translations

* Update messages

* Use esbuild to build storybook

Co-authored-by: Bartłomiej Wiaduch <tukan2can@gmail.com>
Co-authored-by: Jakub Majorek <majorek.jakub@gmail.com>
2022-05-05 09:54:28 +02:00

42 lines
1.4 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
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({
exclude: /node_modules/,
loader: "esbuild-loader",
options: {
loader: "tsx",
target: "es2015"
},
test: /\.(jsx?|tsx?)$/
});
config.optimization.removeAvailableModules = false;
config.optimization.removeEmptyChunks = false;
config.optimization.splitChunks = false;
config.resolve.extensions.push(".ts", ".tsx");
config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: "./tsconfig.json"
})
];
// Resolve macaw ui's peer dependencies to our own node_modules
// to make it work with npm link
config.resolve.alias = {
react: path.resolve("./node_modules/react"),
"react-dom": path.resolve("./node_modules/react-dom"),
"@material-ui/core": path.resolve("./node_modules/@material-ui/core"),
"@material-ui/icons": path.resolve("./node_modules/@material-ui/icons"),
"@material-ui/styles": path.resolve("./node_modules/@material-ui/styles")
};
config.plugins.push(
new CheckerPlugin({
eslint: true
})
);
return config;
};