Questions tagged [terser-webpack-plugin]
14 questions
2
votes
0 answers
webpack/terser: How can I exclude a package from minification, but still include that package in the packed result?
I've found a number of solutions for excluding particular modules from minification, but all of the solutions I've seen so far not only skip minification of those packages, they cause those packages to be completely omitted from webpack's output,…

kshetline
- 12,547
- 4
- 37
- 73
1
vote
0 answers
webpack terser minify imported library
I'm using webpack for an internal project. The project is set to be minified with TerserPlugin.
The project also uses paper js library to deal with some SVG transformations.
The issue I have is when I build the project for production, all paper…

Andrei
- 367
- 5
- 18
1
vote
0 answers
Prevent TerserWebpackPlugin to remove comments at the end of script
I use TerserWebpackPlugin with comments: true. But Terser removes comments after useful code - at the end of file. I would like to avoid this behavior.
console.log('Example2');
// any comments will be removed from here
/* myComment after */
//…

user64667
- 43
- 6
1
vote
1 answer
issue with React Scripts and terser-webpack-plugin
As of yesterday, I suddenly started getting this error when running the 'npm start' script in my create-react-app. I never had this issue before, and have not changed any configuration or package.json files in or out of react-scripts.…

Cancid
- 15
- 7
0
votes
0 answers
Web pack build fails with Non-Zero Exit Code detected
| | 228 ms (parallelism 80.7) build modules > ./app/components/TabButton/A.js
| | 228 ms (parallelism 80.7) build modules > ./app/components/TabButton/Wrapper.js
| 129273 ms build modules > 1329 x javascript/auto with…

Siva
- 61
- 1
- 5
0
votes
0 answers
How to know if minification process is successful after deployment?
I am facing issue running npm run build during the minification process as this. Most of the solutions given is to upgrade to react-scripts v2.x.x is not a viable option for me. So I am currently implementing this solution which suggests to use…

aab
- 1
- 1
0
votes
0 answers
How to exclude specific node module from minification in next.js app
In my next.js app I am using a package called 'js-interpreter', residing in node_modules/js-interpreter, which is a pre-minified package. So, when I create my build with next build it further minifying the js-interpreter package and crashing its…
0
votes
0 answers
Terser plugin Unexpected token: operator (<)
I get this error message when i run cross-env NODE_ENV=production webpack --config
There is a problem with the terser pluggin, but didn't find anything about this, that could solve my problem.
There is my config/webpack.prod.js :
ERROR in…

isidore
- 11
- 2
0
votes
0 answers
Failed to minify the bundle. Error: static/js/2.2c2ccbd8.chunk.js from Terser
When I am trying to deploy my react app on AWS Amplify I am getting below error. We are using Amplify for last 2 years.
It was working fine till last week but now its build is failing.
I am using NODE_OPTIONS=--max_old_space_size=4096 in build…

Minnat Ali
- 11
- 2
0
votes
0 answers
Webpack importing all the files from the export file in production bundle
Webpack not removing unused code in production (final) bundle
Here is my scenario
file-a.js
import {otherfunction} from "./anotherFile.js"
export const sendAjaxRequest() /** common function to send a ajax Request**\
file-b.js
import…

Vijay
- 49
- 4
0
votes
1 answer
Terser Plugin doesnt run with Vue CLI 5 on vue build
I am trying to create a production build with the following configureWebpack but Terser doesnt run during build.
Code is not minimized or uglified. Ialso tried hidden-source-map
Using "terser-webpack-plugin": "^5.3.3" with @vue/cli@5.0.7
isProd is…

Constantinos N
- 253
- 3
- 17
0
votes
1 answer
Minify calls to Math, Number, etc. with Terser
The code that Terser produces for my project contains many calls to the Javascript Math object and I am wondering if there is an easy way to minify these calls.
Here is a screenshot of part of the minfied code with Math highlighted (altogether there…

Waruyama
- 3,267
- 1
- 32
- 42
0
votes
1 answer
Cannot find module terser-webpack-plugin when run yarn serve in Vue 3 project
I just created a Vue 3 project using Vue CLI using the default options, and when I try to run using yarn serve command I got this error
Error: Cannot find module '.../node_modules/terser-webpack-plugin/dist/index.js'. Please verify that the…

Alexandre Heinen
- 623
- 1
- 7
- 19
0
votes
0 answers
terser-webpack-plugin doesn't support IE11
I've to update uglify-webpack-plugin due to server restrictions, so I found terser-webpack-plugin is in the suggestion, however it doesn't support IE11 by default.
It just shows a syntax error in the vendor.js file, while loading the app.
Anyone…

Aniruddha Shevle
- 4,602
- 4
- 22
- 36