16 questions
1
vote
0
answers
47
views
For angular webpack based builders, how to config the `define` for tree shaking or compress in the built-in javaScriptOptimizerPlugin
For angular webpack based builders, how to config the define for tree sharking or compress in the built-in javaScriptOptimizerPlugin ?
async function optimizeWithEsbuild(content, name, options) {
...
0
votes
1
answer
307
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
132
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&...
4
votes
0
answers
357
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
511
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
277
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 ...
3
votes
0
answers
629
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
377
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
2k
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
1k
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
2k
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-...
5
votes
0
answers
2k
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 ...
0
votes
1
answer
219
views
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 ...
1
vote
1
answer
6k
views
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-...
0
votes
0
answers
235
views
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 ...