I am trying to use Closure compiler to concatenate javascript files - possibly before code optimization for better results in code optimization. I am new to closure and I cant find a way to concatenate js files with closure. I would love it if its possible to write a closure script to concatenate files, move them between folders etc.
Here's an example of what I'm looking for: These are three js files
//A.js
require ("B");
require ("C");
function x(){...} //Calls y() and calls z()
//B.js
require ("C");
export function y(){...} //Calls z()
//C.js
export function z(){...}
Concatenate B.js and C.js into one file and make it look like this:
//A.js
require ("B");
function x(){...} //Calls y() and calls z()
//B.js
export module B{
export function y(){...} //Calls z()
export function z(){...}
}
After this restructuring I would like closure to optimize and obfuscate A.js and B.js