const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const babel = require('rollup-plugin-babel');
const uglify = require('rollup-plugin-uglify').uglify;

const pkg = require('./package.json');
const version = process.env.VERSION || pkg.version;
const name = process.env.NAME || pkg.name;
const author = process.env.AUTHOR || pkg.author;

const banner = `/* 
 * @preserve
 * ${name}.js v${version}
 * ${new Date().getFullYear()} - powered by ${author}
 */
`
const config = module.exports = {

  input: 'src/main.js',
  output: {
    file: `dist/${name}.js`,
    format: 'umd',
    name: name,
    banner: banner
  },
  plugins: [
    resolve(),
    commonjs(),
    babel()
  ]

}

if (process.env.NODE_ENV === 'production') {
  config.plugins.push(uglify({
    output: {
      comments: function (node, comment) {
        var text = comment.value;
        var type = comment.type;
        if (type == "comment2") {
          return /@preserve|@license|@cc_on/i.test(text);
        }
      }
    }
  }));
} else {
  config.output.file = `dist/${name}.dev.js`;
}
@@ -509,23 +509,70 @@
 /%0A%60%0A
+%0A
 const 
-config = 
+isProduction = process.env.NODE_ENV === 'production';%0A%0A
 modu
@@ -646,17 +646,53 @@
 /$%7Bname%7D
-.
+$%7BisProduction ? '.min.' : '.debug.'%7D
 js%60,%0A   
@@ -806,84 +806,30 @@
 el()
+,
 %0A  
-%5D%0A%0A%7D%0A%0Aif (process.env.NODE_ENV === 'production') %7B%0A  config.plugins.push(
+  isProduction && 
 ugli
@@ -833,16 +833,18 @@
 glify(%7B%0A
+  
     outp
@@ -851,24 +851,26 @@
 ut: %7B%0A      
+ 
+ 
 comments: fu
@@ -898,24 +898,26 @@
 ) %7B%0A        
+  
 var text = c
@@ -934,24 +934,26 @@
 ue;%0A        
+ 
+ 
 var type = c
@@ -965,16 +965,18 @@
 t.type;%0A
+  
         
@@ -1011,16 +1011,18 @@
         
+  
 return /
@@ -1065,26 +1065,30 @@
 t);%0A        
-%7D%0A
+  %7D%0A  
       %7D%0A    
@@ -1091,69 +1091,21 @@
     
-%7D%0A
   %7D
-));%0A%7D else %7B%0A  config.output.file = %60dist/$%7Bname%7D.dev.js%60;
+%0A    %7D)%0A  %5D%0A
 %0A%7D

modify rollup configuration