dongyuwei / CommonJS.erl

A CommonJS Module Packager in Erlang
Other
3 stars 0 forks source link

production mode optimization #5

Open dongyuwei opened 5 years ago

dongyuwei commented 5 years ago

Do the similar optimization of production mode webpack/minipack, key point is not use eval/new Function to execute js module.

dongyuwei commented 5 years ago

wrap module code in

function (module, exports, require){
   /* module file content, raw source code */
}