@ardatan/bob
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -9,3 +9,4 @@ #!/usr/bin/env node | ||
const generatePackageJson = require("rollup-plugin-generate-package-json"); | ||
async function build({ options, pkg }) { | ||
async function build(pkg) { | ||
const options = pkg.buildOptions; | ||
const inputOptions = { | ||
@@ -48,2 +49,20 @@ input: options.input, | ||
await Promise.all(generates.map(outputOptions => bundle.write(outputOptions))); | ||
if (pkg.buildOptions.bin) { | ||
await Promise.all(Object.keys(pkg.buildOptions.bin).map(async (alias) => { | ||
const options = pkg.buildOptions.bin[alias]; | ||
const inputOptions = { | ||
input: options.input, | ||
plugins: [ | ||
typescript(), | ||
], | ||
}; | ||
const bundle = await rollup.rollup(inputOptions); | ||
await bundle.write({ | ||
preferConst: true, | ||
sourcemap: options.sourcemap, | ||
file: pkg.bin[alias], | ||
format: 'cjs', | ||
}); | ||
})); | ||
} | ||
} | ||
@@ -53,3 +72,3 @@ async function main() { | ||
const pkg = readPackageJson(cwd); | ||
await build({ pkg, options: pkg.buildOptions }); | ||
await build(pkg); | ||
} | ||
@@ -95,2 +114,8 @@ main().catch(err => { | ||
newPkg.typings = transformPath(pkg.typings); | ||
if (pkg.bin) { | ||
newPkg.bin = {}; | ||
for (const alias in pkg.bin) { | ||
newPkg.bin[alias] = transformPath(pkg.bin[alias]); | ||
} | ||
} | ||
// if (produceUMD) { | ||
@@ -97,0 +122,0 @@ // newPkg.unpkg = pkg.typings.replace('dist/', ''); |
{ | ||
"name": "@ardatan/bob", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "bin": { |
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
4844
138