crude-build
Advanced tools
Comparing version 0.0.9 to 0.1.0
@@ -100,3 +100,14 @@ | ||
window['${moduleName}'] = ${moduleName}; | ||
if (typeof define === 'function' && define['amd']) { | ||
define([], function() { | ||
return ${moduleName}; | ||
}); | ||
} else if (typeof exports === 'object') { | ||
Object.defineProperty(${moduleName}, "__esModule", { 'value': true }); | ||
${moduleName}['default'] = ${moduleName}; | ||
${moduleName}['${moduleName}'] = ${moduleName}; | ||
module['exports'] = ${moduleName}; | ||
} else { | ||
window['${moduleName}'] = ${moduleName}; | ||
} | ||
@@ -110,2 +121,6 @@ })(this); | ||
if (type === "var") { | ||
str += "var module;\n"; | ||
} | ||
for (let e of externs) { | ||
@@ -142,5 +157,5 @@ switch (type) { | ||
// Extract externs in format "/* import Quaternion from quaternion */" | ||
// Extract externs in format "import Quaternion from quaternion;" | ||
const externs = []; | ||
sourceCode = sourceCode.replace(/\/\*\s*import\s*([a-z0-9.-]+)\s*from\s*([a-z0-9.-]+)\s*\*\//ig, function (_, name, inc) { | ||
sourceCode = sourceCode.replace(/\s*import\s*([a-z0-9.-]+)\s*from\s*([a-z0-9.-]+)\s*;?/ig, function (_, name, inc) { | ||
externs.push({ name, inc }); | ||
@@ -174,4 +189,3 @@ return ''; | ||
externs: 'externs.js', | ||
emit_use_strict: true, | ||
languageOut: 'ES6' | ||
emit_use_strict: true | ||
}); | ||
@@ -178,0 +192,0 @@ |
{ | ||
"name": "crude-build", | ||
"title": "Crude Build", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/rawify/CrudeBuild.js", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/rawify/CrudeBuild.js/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9792
158