Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

I get these errors when I try to build my nextjs project static/chunks/36443.1f4a0592caf86eec.js from Terser invalid unicode code point at line 1 column 454144 I tried removing node_modules and ...
Konul Memmedova's user avatar
0 votes
1 answer
102 views

My rollup config is generating source maps for me. They just aren't very good source maps. They aren't doing a good job of restoring full original variable and function names, only a smattering of the ...
kshetline's user avatar
  • 14k
1 vote
1 answer
757 views

Consider this repro script. #!/bin/bash -x rm -rf my-vanilla-lib npm create vite@latest my-vanilla-lib -- --template vanilla cd my-vanilla-lib npm i cat <<EOL > vite.config.js export default ...
Dan Fabulich's user avatar
  • 40.1k
0 votes
1 answer
46 views

I am trying to integrate terser js minification in a django collectstatic command , by overriding the CompressedManifestStaticFileStorage of whitenoise in below code , but the def _save() method ...
Tushar Chaudhary's user avatar
1 vote
0 answers
498 views

I'm trying to get vite to user terser and preserve some comments. Well, any comments at this point. This is the build section of my vite config: export default defineConfig({ plugins: [ vue(), ...
Bob Ramsey's user avatar
0 votes
1 answer
126 views

We are using server side rendering with GraalVM. Application is throwing below error org.graalvm.polyglot.PolyglotException: TypeError: <this>.clearProviders is not a function at <js&...
Vikram's user avatar
  • 60
0 votes
0 answers
404 views

Using the drop_console option into metro.config.js as per documentation here does not remove console.logs from the production build. const { getSentryExpoConfig } = require('@sentry/react-native/metro'...
Andrew Radulescu's user avatar
0 votes
1 answer
495 views

I am unable to minify and building code with Terser in Webpack. I get the following error while running my production build: cart-ts.js from Terser plugin "Import" statement may only appear ...
violetflare's user avatar
3 votes
1 answer
339 views

I'm experiencing a build failure in my Next.js project when attempting to create an optimized production build (next build). The build process fails specifically due to an issue with Terser, which ...
T. Grumser's user avatar
1 vote
0 answers
48 views

In my index.html, I will call a index.js file and that file will import other files/variable. It keeps on say some variables is redeclared after compiling the js files into one file. As I need to ...
user3456122's user avatar
2 votes
0 answers
97 views

First of all I'm upgrading rails from 4 to 6 version. I have a separate fronted project that's based on webpack and as a result it produces js output file. Let's name it ui.js This file is later taken ...
Panczo's user avatar
  • 444
0 votes
0 answers
477 views

How can I configure Rollup and it's terser plugin to create a sourcemap for my web app's minified javascript bundle, that doesn't have any of my javascript source code comments? I am using terser to ...
SpechtacularDave's user avatar
0 votes
0 answers
35 views

I am new to JavaScript so forgive the simple question - after doing a lot of research, I am even more confused... The app I am writing had production (display of data etc.) and developer (tools to ...
Molly Birk's user avatar
0 votes
1 answer
263 views

I have PHP script that automates my dev-to-production proces. I want to use Terser to minify the JS in my project. But when I fire it with the php exec() function, I get a result value of 1. This ...
FvEldijk's user avatar
  • 107
0 votes
1 answer
136 views

I am trying to create a yml file for a Github locally hosted action runner that calls an npm module called "terser" to minify js and css. - name: Minify_JS if: ${{ contains(inputs....
gabriel's user avatar
  • 384
1 vote
0 answers
246 views

Let's consider this code : class Foo { type; constructor(type) { this.type = type; } foo() { this.type === 'animation' ? create() : createNoop(); } } new Foo('animation') ...
Matthieu Riegler's user avatar
1 vote
0 answers
235 views

I'm trying to do a JS compiler in Node for websites, but I'm hitting a snag. My compiles keep imports set in the JS. So when its read by the browser it says Uncaught SyntaxError: Cannot use import ...
Fredy31's user avatar
  • 2,837
1 vote
0 answers
374 views

I want do preserve dedicated comments which contain delimiters for Thymeleaf's processing engine. When Thymeleaf finds these delimiters inside comments, it will parse the content, remove the comment ...
Slevin's user avatar
  • 1,366
0 votes
1 answer
228 views

The problem happens when I use text editor on admin part of website with enabled prerender mode. html-minifier-terser dies when it meets contents of <.code> tag What could be a workaround for ...
Daniel's user avatar
  • 1,265
0 votes
2 answers
2k views

I'm using npm scripts to compile and minify sass and potentionally javascript files. However, I'm looking for at way to specify a source folder of *.js files and have them minified and saved in a ...
Meek's user avatar
  • 3,372
0 votes
1 answer
432 views

I am using terser to compress my code. But it turns out that it removes a function that is called only in html code (I understand that I set module: true) I also set dead_code: false to keep ...
deekep's user avatar
  • 161
1 vote
0 answers
353 views

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 ...
Andrei's user avatar
  • 377
10 votes
2 answers
11k views

one of our third party libraries requires us to preserve specific function names. in webpack we did that with terser.keep_fnames. esbuild has https://esbuild.github.io/api/#keep-names so we'd like to ...
Alex Spieslechner's user avatar
0 votes
1 answer
573 views

I have a problem with terser-webpack-plugin I can't minify my bundle the error is ERROR in bundle.js from Terser Invalid assignment bundle.js I have the version of "terser-webpack-plugin": &...
Lorgio Roda's user avatar
1 vote
0 answers
2k views

I'm trying to upgrade mui, rollup, nodejs and npm but encountered this errorenter image description here tsconfig all packages are in their latest version tried these: Rollup is not generating ...
fe_developer's user avatar
0 votes
1 answer
486 views

Below is my Firebase hosting project folder structure: projectFolder/store/public/scripts/*.min.js projectFolder/src/*.js After running terser, all my projectFolder/src/*.js will be minified to ...
Antonio Ooi's user avatar
  • 1,822
2 votes
2 answers
2k views

I've been cleaning up my npm audit errors and after I was done I could not execute npm tun build anymore. Error ERROR in web/themes/custom/js/funds-chunk.js from Terser Unexpected token: punc ()) [...
Little_bugfixer's user avatar
2 votes
1 answer
1k views

After a pnpm package update, I can't start my SvelteKit project anymore. Something is messy with the tooling: pnpm, vite, sass, terser or sveltekit, I don't know. > pnpm run dev VITE v4.0.0 ready ...
Big_Boulard's user avatar
  • 1,385
0 votes
1 answer
429 views

I am using the latest https://github.com/terser/html-minifier-terser 7.0.0 (https://www.npmjs.com/package/html-minifier-terser) The readme states Minify JavaScript in script elements and event ...
handle's user avatar
  • 6,500
0 votes
0 answers
145 views

Is it possible in an Angular 13 project to change the content in the generated main.js file before it is given to the minifier/optimizer/obfuscator (in Angular, it is terser)? A very exotic ...
yonexbat's user avatar
  • 3,012
4 votes
2 answers
2k views

I want to keep ALL my variables and function names, even the private ones, and only mangles the ones that match the regex. The docs say: regex (default: null) — Pass a RegExp literal or pattern ...
Julian's user avatar
  • 826
1 vote
0 answers
211 views

I am using browserify with babelify to transpile React code from ES6 and everything went smoothly until trying to minify using Uglify and discovered that Uglify doesn't do ES6 syntax, so I switched to ...
Alex's user avatar
  • 11
0 votes
1 answer
984 views

I want to compress my js files using Terser Plugin. Here is my dependencies "dependencies": { "axios": "^0.26.0", "core-js": "^3.6.5", &...
seary's user avatar
  • 77
0 votes
0 answers
539 views

Is there any way for terser to minify/hoist the this variable so it does not appear repeated as often in the bundle? Example code: class MyClass { constructor(handler) { this.handler = ...
José Cabo's user avatar
  • 6,961
5 votes
0 answers
2k views

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 ...
kshetline's user avatar
  • 14k
0 votes
1 answer
203 views

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 ...
Waruyama's user avatar
  • 3,543
1 vote
1 answer
6k views

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-...
Alexandre Heinen's user avatar
1 vote
1 answer
4k views

I need: minify JS file with extension from the store, but I can't find an option to remove whitespace between html tags in variables I use: JS & CSS Minifier (Minify) - https://marketplace....
pepeD's user avatar
  • 174
2 votes
1 answer
680 views

To assist with optimization Terser supports the pure comment to indicate that a function call is pure. Specifically, the docs give only the following example. const x = /*#__PURE__*/...
Peter Gerdes's user avatar
  • 3,113
4 votes
1 answer
2k views

More and more modern Typescript transpilers have moved toward a strategy of per-module transpilation, which significantly increases build speed, but eliminates the possibility for cross-module const ...
casieber's user avatar
  • 7,612
3 votes
1 answer
1k views

Good day everyone! When I tried to build my parcel-based app, I encountered the following error: Build failed. @parcel/optimizer-terser: "_" is redeclared 3724 | > 3725 | let _ = (t1)=...
Maxieprodmoore's user avatar
2 votes
2 answers
4k views

I have a Razzle app and build is broken. It doesn't make sense as the error shown in build result points to something that doesn't exist in my code. This is the error message from Terser: 'Unexpected ...
Ricardo Gaefke's user avatar
5 votes
0 answers
2k views

I have had some success minifying a .js file using terser. However, I have so far not been able to minify a standalone CSS file, and this is the reason for this qestion. I have installed html-minifier-...
tyogi's user avatar
  • 670
3 votes
2 answers
3k views

Is there a way to not mangle only one function name? A comment in the code would be easiest, but I guess this could be done by specifying a custom "nameCache" ? But I don't know how that ...
AaronJ's user avatar
  • 1,182
2 votes
0 answers
290 views

I have a dependency that includes references to document that gets imported into a service worker. The documents are tree-shaken out in production mode. However, I actually need for my service worker ...
AntonOfTheWoods's user avatar
2 votes
0 answers
289 views

I'm using Webpack 4, SourceMapDevToolPlugin and terser-webpack-plugin. The problem is that I need to also modify the minified JS-bundles – inject specific code to the beginning of file. The mutation ...
Artem Yankin's user avatar
4 votes
3 answers
2k views

I am facing one particular issue often talked about at various places the link I will share later. The problem is related to the webpack bundling. My nodeJS application uses @azure/storage-blob ...
Sudhir's user avatar
  • 817
0 votes
1 answer
181 views

I am using angular11 and after removing the bootstrap from my project it gives below error when run command ng build --prod Earlier it is working fine. i tried to update core and terser depenadicies ...
Som's user avatar
  • 76
1 vote
2 answers
1k views

I want to use Sprockets at the command line (with the ruby-sprockets Debian package), and I want to use Terser as the JavaScript compressor (because Uglify doesn't support ES6). All the documentation ...
crunchytacogal's user avatar
4 votes
2 answers
2k views

I think I'm going insane, because every search engine throws me only results on how to remove the comments from output file and that's completely opposite of what I searched for 😤 I use all defaults ...
Sharak's user avatar
  • 1,022