Fix sticker-creator

This commit is contained in:
Fedor Indutny 2021-12-20 17:58:55 +01:00 committed by GitHub
parent 0a58b0a8f4
commit 67f4c5544c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -428,6 +428,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',