Fix sticker-creator

This commit is contained in:
Fedor Indutny 2021-12-07 19:46:08 +01:00 committed by GitHub
parent f720904ca5
commit 419d1ca176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -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}",
"!**/._*",

View file

@ -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',