@userfrosting/browserify-dependencies
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
@@ -10,4 +10,6 @@ # Changelog | ||
## [1.0.0-alpha.2] - 2019-01-07 | ||
## [1.0.0-alpha.1] - 2019-01-07 | ||
Inital release |
@@ -21,7 +21,13 @@ import Browserify from "browserify"; | ||
const targetPath = (() => { | ||
// Handle incomplete main attribute | ||
if (lstatSync(depOptions.browserifyOptions.entries).isDirectory()) | ||
return joinPathSegments(options.outputDir, depName, pkg.main || "./", "index.js"); | ||
else | ||
return joinPathSegments(options.outputDir, depName, pkg.main); | ||
try { | ||
if (lstatSync(depOptions.browserifyOptions.entries).isDirectory()) | ||
// Handle folder and no main | ||
return joinPathSegments(options.outputDir, depName, pkg.main || "./", "./index.js"); | ||
} | ||
catch (_a) { | ||
// Handle file without extension (assume js) | ||
return joinPathSegments(options.outputDir, depName, pkg.main + ".js"); | ||
} | ||
// And finally, handle exact path | ||
return joinPathSegments(options.outputDir, depName, pkg.main); | ||
})(); | ||
@@ -28,0 +34,0 @@ // Ensure directory tree exists |
{ | ||
"name": "@userfrosting/browserify-dependencies", | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Run browserify against all dependencies defined in package.json", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
8495
109