Commit c7951a25 by Tobias Skarhed Committed by GitHub

Storybook: Solve deployment issues (#22873)

parent 18f1d5a8
const path = require('path'); const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = ({ config, mode }) => { module.exports = ({ config, mode }) => {
config.module.rules = [ config.module.rules = [
...(config.module.rules || []), ...(config.module.rules || []),
...@@ -74,6 +76,18 @@ module.exports = ({ config, mode }) => { ...@@ -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.resolve.extensions.push('.ts', '.tsx', '.mdx');
config.stats = { config.stats = {
warningsFilter: /export .* was not found in/, warningsFilter: /export .* was not found in/,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment