Questions tagged [terser-webpack-plugin]
The terser-webpack-plugin tag has no usage guidance.
terser-webpack-plugin
18
questions
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="...
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&...
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, ...
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
...
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....
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 ...
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 ...
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: ...
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 ...
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 ...
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 ...
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 ...
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-...
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 ...
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 ...