I'm using uglify-js to minify the source code. I want to remove
const moment = require('moment');
const PouchDB = require('pouchdb');
module.exports = Chart;
statements of the original source code. Is it possible? Or is there any other compressor tool supports this?
I use the code as below in Node.js.
'use strict'
const moment = require('moment');
const PouchDB = require('pouchdb');
const defaultcachetime = 12; // hours
const VERIFIED = 3;
const UNIQUCOUNTER = 1;
var caches = {};
var cachechange = {};
function Chart(path, credentials, user){
}
module.exports = Chart;
The output contains
"use strict";const moment=require("moment"),PouchDB=require("pouchdb") return a},module.exports=Chart;
Thank you for helping
Managed to overcome the challenge by doing
Browserify to convert Require and Import keywords to FE parsable code.
Minify JS code with Uglify
Hope it helps with anyone who might be facing the same challenge.