saleor-dashboard/src/storybook/webpack.config.js

36 lines
953 B
JavaScript
Raw Normal View History

2019-06-19 14:40:52 +00:00
/* eslint-disable */
2019-08-27 11:02:47 +00:00
const path = require("path");
2019-06-19 14:40:52 +00:00
const CheckerPlugin = require("fork-ts-checker-webpack-plugin");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
2019-08-27 11:02:47 +00:00
const resolve = resolvePath => path.resolve(__dirname, resolvePath);
2019-08-09 11:14:35 +00:00
module.exports = ({ config }) => {
2019-06-19 14:40:52 +00:00
config.module.rules.push({
2019-08-27 11:02:47 +00:00
test: /\.(jsx?|tsx?)$/,
2019-06-19 14:40:52 +00:00
exclude: /node_modules/,
2019-08-27 11:02:47 +00:00
loader: "babel-loader",
2019-06-19 14:40:52 +00:00
options: {
2019-08-27 11:02:47 +00:00
configFile: resolve("../../babel.config.js"),
envName: "storybook"
2019-06-19 14:40:52 +00:00
}
});
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"
})
];
2019-11-05 14:39:47 +00:00
config.plugins.push(
new CheckerPlugin({
compilerOptions: {
skipLibCheck: true
}
})
);
2019-06-19 14:40:52 +00:00
return config;
};