Comparing version 0.2.0 to 0.2.1
17
index.js
@@ -38,3 +38,2 @@ var through = require('through2'), | ||
var contents = fn.source; | ||
var pos = contents.indexOf('\n'); | ||
if (options.amd === false) { | ||
@@ -46,10 +45,14 @@ options.format = ''; | ||
} else if (options.format === 'cjs') { | ||
contents = [ | ||
fn.head || '', | ||
'module.exports = ' + contents.substr(0, pos), | ||
contents.substr(pos) | ||
].join('\n'); | ||
contents = 'module.exports = ' + contents; | ||
if (fn.head) { | ||
contents = fn.head + "\n" + contents; | ||
} | ||
} else if (options.format === 'module') { | ||
contents = 'export default ' + contents; | ||
if (fn.head) { | ||
contents = fn.head + "\n" + contents; | ||
} | ||
} | ||
file.contents = new Buffer(contents); | ||
file.contents = Buffer.from(contents); | ||
file.path = file.path.replace('.vdt', '.js'); | ||
@@ -56,0 +59,0 @@ |
{ | ||
"name": "gulp-vdt", | ||
"description": "a plugin of gulp for compiling vdt template", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "index.js", | ||
@@ -13,2 +13,3 @@ "repository": { | ||
"gulp-util": "^3.0.6", | ||
"source-map": "^0.7.3", | ||
"through2": "^2.0.0" | ||
@@ -20,5 +21,5 @@ }, | ||
"devDependencies": { | ||
"gulp": "^3.9.0", | ||
"gulp": "^4.0.0", | ||
"vdt": "^1.1.2-22" | ||
} | ||
} |
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
2667
54
4
3
+ Addedsource-map@^0.7.3
+ Addedsource-map@0.7.4(transitive)