Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep javascript bundle file beautify using uglify

I'm using rollup-plugin-uglify with rollup I got development and production version of my JS bundle and I want on dev mode. keep my file beautify though I'm using uglify

I tried to specified it as follows (on development build):

import uglify from 'rollup-plugin-uglify';

export default {
    entry: 'myfile.js',
    dest: 'mybundle.js',
    plugins: [uglify({
        beautify: true,
        mangle: false,
        compress:false
    })]
}

I'm using rollup-plugin-uglify with rollup I got development and production version of my js bundle and I want on development mode keep my file beautify though i'm using uglify

But unfortunately the file output still uglified.

Any idea?

like image 923
ofer goli Avatar asked Mar 07 '26 18:03

ofer goli


1 Answers

If you will look at uglify api https://github.com/mishoo/UglifyJS2/blob/master/README.md#api-reference, you'll see that 'beautify' option has 'output' namespace. Rollup plugin just directly passed options to uglify.

like image 90
Bogdan Chadkin Avatar answered Mar 10 '26 08:03

Bogdan Chadkin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!