Skip to main content

Questions tagged [terser-webpack-plugin]

The tag has no usage guidance.

terser-webpack-plugin
0 votes
0 answers
15 views

terser-webpack-plugin and uglifyjs-webpack-plugin

Since webpack 4 is using terser-webpack-plugin by default in production mode or when we specify -p argument which is a shortcut for specifying --optimize-minimize --define process.env.NODE_ENV="...
Vikram's user avatar
  • 50
0 votes
1 answer
38 views

ReactDOMServer's renderToString method throwing error : clearProviders is not a function

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
  • 50
0 votes
0 answers
13 views

In terser-webpack-plugin, how to keep the string specified in the function?

terser-webpack-plugin version: 5.3.3 webpack version: 5.89.0 enter image description here function shouldResponse() { "worklet"; return this.responseResult; } When I build above code, ...
will luobin's user avatar
0 votes
0 answers
49 views

Terser Webpack Plugin Error - RangeError - Invalid String Error

We use webpack v4 that uses terser-webpack-plugin to generate a SSR build of a react application. Our application build is generated in two phases: Phase 1 - all static files [js, css] are generated ...
Rahul Ranjan's user avatar
4 votes
0 answers
149 views

Prevent module name from being minified in webpack bundle

I have a host application that consumes a remote package through a script tag. My remote package includes the following ModuleFederationPlugin config within the webpack config plugins: [ new webpack....
sfletche's user avatar
  • 49.1k
0 votes
1 answer
176 views

Webpack 5 (TerserPlugin) - "Import" statement may only appear at the top level

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
0 votes
1 answer
126 views

I Can See Source Code on Browser Even After I Uglify the Project

My problem is, I can see my source code in browser even after I use Terser Plugin with Webpack. The problem is, I use Terser Plugin for transforming my code into non human readable code chunks. After ...
Alihan Keskin's user avatar
0 votes
0 answers
131 views

Terser mangle props accessed by string vars

Is there a way to change the mangled key from string vars or prevent mangling the prop if accessed by var? Ex: # webpack.js new TerserPlugin({ parallel: false, terserOptions: { nameCache: ...
Cristi's user avatar
  • 95
1 vote
0 answers
453 views

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 ...
Usaid Khan's user avatar
1 vote
0 answers
265 views

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 ...
Andrei's user avatar
  • 367
1 vote
2 answers
1k views

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 ...
isidore's user avatar
  • 25
2 votes
0 answers
995 views

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 ...
user64667's user avatar
0 votes
1 answer
1k views

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-...
Constantinos N's user avatar
4 votes
0 answers
1k views

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 ...
kshetline's user avatar
  • 13.3k
1 vote
1 answer
2k views

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 ...
Cancid's user avatar
  • 15

15 30 50 per page