Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Turn Module Into Non Module

You can a module into a non module by removing the export (default) part and then wrapping the code in a self invoking function
For example

let x = "XXX";
export default x;


becomes

(function(){
const x = "XXXX";
export default x;
})()
 
PREVIOUS NEXT
Tagged: #Turn #Module #Into #Non #Module
ADD COMMENT
Topic
Name
2+8 =