Storybook: Solve deployment issues (#22873)

This commit is contained in:
Tobias Skarhed 2020-03-19 07:51:22 +01:00 committed by GitHub
parent 18f1d5a83d
commit c7951a2575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,6 @@
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = ({ config, mode }) => {
config.module.rules = [
...(config.module.rules || []),
@ -74,6 +76,18 @@ module.exports = ({ config, mode }) => {
],
});
config.optimization = {
nodeEnv: 'production',
minimizer: [
new TerserPlugin({
cache: false,
parallel: false,
sourceMap: true,
}),
new OptimizeCSSAssetsPlugin({}),
],
},
config.resolve.extensions.push('.ts', '.tsx', '.mdx');
config.stats = {
warningsFilter: /export .* was not found in/,