diff --git a/package.json b/package.json index 8ec1153865c..cfa86662cb1 100644 --- a/package.json +++ b/package.json @@ -444,6 +444,7 @@ "!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,test,__tests__,tests,powered-test,example,examples,*.d.ts,.snyk-*.flag,benchmark}", "!**/node_modules/.bin", "!**/node_modules/**/build/**", + "node_modules/intl-tel-input/build/**", "!**/node_modules/**/prebuilds/**", "!**/*.{o,hprof,orig,pyc,pyo,rbc}", "!**/._*", diff --git a/webpack.config.ts b/webpack.config.ts index 9607c90489e..f6802b493ac 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -5,6 +5,7 @@ import { resolve } from 'path'; // eslint-disable-next-line import/no-extraneous-dependencies import { Configuration, EnvironmentPlugin, ProvidePlugin } from 'webpack'; import HtmlWebpackPlugin = require('html-webpack-plugin'); +import TerserPlugin = require('terser-webpack-plugin'); const context = __dirname; const { NODE_ENV: mode = 'development' } = process.env; @@ -34,6 +35,19 @@ const stickerCreatorConfig: Configuration = { 'typeface-inter', './sticker-creator/index.tsx', ], + // Stack-traces have to be readable so don't mangle function names. + optimization: { + minimizer: [ + new TerserPlugin({ + parallel: true, + terserOptions: { + mangle: false, + keep_classnames: true, + keep_fnames: true, + }, + }), + ], + }, output: { path: resolve(context, 'sticker-creator/dist'), filename: 'bundle.js',