Set of tools for handling web assets aggregation (with compilation, minify, obfuscate) for typescript/javascript and scss/css files
npm install @erez111/web-assets-aggregator
...
"scripts": {
...
"generate": "web-assets-aggregator generate --output js --target aggregate.js --sources source1.js source2.ts",
"build": your build original implementation,
"postbuild": "npm run generate"
}
...
`
$3
`
npm run generate
`
or create "post" script to make use life cycle scripts events. Example:
`
npm run build
`
#### source1.js
`
/**
* Comment for test source file
*/
console.log('this is a javascript test');
`
#### source2.ts
`
/**
* Comment for test source file
*/
console.log('this is a typescript test');
`
#### Output file "aggregate.js" (aggregated, minified & obfuscated)
`
'use strict';var a0_0x4fa252=a0_0x4689;function a0_0x16bc(){var _0x26c26c=['2744154BgKURx','log','3241651cecBlL','6PXruGz','10mJLTkN','1jvIVJn','2044308GUqKqd','33344223uehEBP','5112582iDzjgH','4885115SUWgWr','2509454xMqJnX','8hbiAcT'];a0_0x16bc=function(){return _0x26c26c;};return a0_0x16bc();}(function(_0x111e9b,_0x1dd149){var _0xbe7b5d=a0_0x4689,_0x3803dd=_0x111e9b();while(!![]){try{var _0x202d85=parseInt(_0xbe7b5d(0x78))/0x1(-parseInt(_0xbe7b5d(0x7d))/0x2)+parseInt(_0xbe7b5d(0x76))/0x3(-parseInt(_0xbe7b5d(0x79))/0x4)+parseInt(_0xbe7b5d(0x7c))/0x5+-parseInt(_0xbe7b5d(0x7b))/0x6+-parseInt(_0xbe7b5d(0x75))/0x7(parseInt(_0xbe7b5d(0x7e))/0x8)+parseInt(_0xbe7b5d(0x7f))/0x9+parseInt(_0xbe7b5d(0x77))/0xa(parseInt(_0xbe7b5d(0x7a))/0xb);if(_0x202d85===_0x1dd149)break;else _0x3803dd'push');}catch(_0x45f4a3){_0x3803dd'push');}}}(a0_0x16bc,0xb00ff));function a0_0x4689(_0x9cf05c,_0x3b818c){var _0x16bcfa=a0_0x16bc();return a0_0x4689=function(_0x46898b,_0xfe005f){_0x46898b=_0x46898b-0x75;var _0x44adb6=_0x16bcfa[_0x46898b];return _0x44adb6;},a0_0x4689(_0x9cf05c,_0x3b818c);}consolea0_0x4fa252(0x80),console'log';
``