Comparing version 1.8.5 to 1.9.0
@@ -27,2 +27,3 @@ #!/usr/bin/env node | ||
"--no-sourcemap": Boolean, | ||
"--external": [String], | ||
"-h": "--help", | ||
@@ -34,2 +35,3 @@ "-v": "--version", | ||
"-m": "--minify", | ||
"-e": "--external", | ||
}, { | ||
@@ -51,2 +53,3 @@ permissive: true, | ||
target: args["--target"], | ||
external: args["--external"], | ||
}; | ||
@@ -68,3 +71,3 @@ return parsedArgs; | ||
} | ||
console.log.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[33m"], args), ["\x1b[0m"])); | ||
console.log.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[33m"], args, false), ["\x1b[0m"], false)); | ||
}, | ||
@@ -76,9 +79,9 @@ error: function () { | ||
} | ||
console.error.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[31m"], args), ["\x1b[0m"])); | ||
console.error.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[31m"], args, false), ["\x1b[0m"], false)); | ||
}, | ||
}; | ||
var version = "1.8.5"; | ||
var version = "1.9.0"; | ||
var helpMessage = "\nUsage: bunchee [options]\n\nOptions:\n -v, --version output the version number\n -w, --watch watch src files changes\n -m, --minify compress output. false by default\n -o, --output <file> specify output filename\n -f, --format <format> specify bundle type: \"esm\", \"cjs\", \"umd\". \"esm\" by default\n --target <target> build environment, use \"node\" for nodejs runtime\n --no-sourcemap disable sourcemap generation, sourcemap generation is enabled by default\n --cwd <cwd> specify current working directory\n -h, --help output usage information\n"; | ||
var helpMessage = "\nUsage: bunchee [options]\n\nOptions:\n -v, --version output the version number\n -w, --watch watch src files changes\n -m, --minify compress output. false by default\n -o, --output <file> specify output filename\n -f, --format <format> specify bundle type: \"esm\", \"cjs\", \"umd\". \"esm\" by default\n -e, --external <mod> specify an external dependency\n --target <target> build environment, use \"node\" for nodejs runtime\n --no-sourcemap disable sourcemap generation, sourcemap generation is enabled by default\n --cwd <cwd> specify current working directory\n -h, --help output usage information\n"; | ||
function help() { | ||
@@ -105,2 +108,3 @@ console.log(helpMessage); | ||
target: target, | ||
external: args.external || [], | ||
watch: !!watch, | ||
@@ -107,0 +111,0 @@ minify: !!minify, |
@@ -52,3 +52,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
} | ||
console.log.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[33m"], args), ["\x1b[0m"])); | ||
console.log.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[33m"], args, false), ["\x1b[0m"], false)); | ||
}, | ||
@@ -60,3 +60,3 @@ error: function () { | ||
} | ||
console.error.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[31m"], args), ["\x1b[0m"])); | ||
console.error.apply(console, tslib.__spreadArray(tslib.__spreadArray(["\x1b[31m"], args, false), ["\x1b[0m"], false)); | ||
}, | ||
@@ -86,7 +86,9 @@ }; | ||
function createInputConfig(entry, pkg, options) { | ||
var _a; | ||
var externals = [pkg.peerDependencies, pkg.dependencies] | ||
.filter(function (n) { return Boolean(n); }) | ||
.map(function (o) { return Object.keys(o); }) | ||
.reduce(function (a, b) { return a.concat(b); }, []); | ||
var useTypescript = options.useTypescript, target = options.target, _a = options.minify, minify = _a === void 0 ? false : _a; | ||
.reduce(function (a, b) { return a.concat(b); }, []) | ||
.concat((_a = options.external) !== null && _a !== void 0 ? _a : []); | ||
var useTypescript = options.useTypescript, target = options.target, _b = options.minify, minify = _b === void 0 ? false : _b; | ||
var typings = pkg.types || pkg.typings; | ||
@@ -93,0 +95,0 @@ var cwd = config.rootDir; |
@@ -1,3 +0,3 @@ | ||
import { CliArgs } from "./types"; | ||
import type { CliArgs } from "./types"; | ||
declare function bundle(entry: string, { cwd, ...options }?: CliArgs): Promise<any>; | ||
export default bundle; |
export { default as bundle } from "./bundle"; | ||
export { CliArgs, BuncheeRollupConfig, } from "./types"; | ||
export type { CliArgs, BuncheeRollupConfig, } from "./types"; |
@@ -1,3 +0,3 @@ | ||
import { PackageMetadata, BuncheeRollupConfig, CliArgs } from "./types"; | ||
import type { PackageMetadata, BuncheeRollupConfig, CliArgs } from "./types"; | ||
declare function createRollupConfig(entry: string, pkg: PackageMetadata, cliArgs: CliArgs): BuncheeRollupConfig; | ||
export default createRollupConfig; |
@@ -1,2 +0,2 @@ | ||
import { InputOptions, OutputOptions, RollupOptions } from "rollup"; | ||
import type { InputOptions, OutputOptions, RollupOptions } from "rollup"; | ||
declare type PackageMetadata = { | ||
@@ -24,2 +24,3 @@ name?: string; | ||
sourcemap?: boolean; | ||
external?: string[]; | ||
}; | ||
@@ -29,2 +30,2 @@ declare type BundleOptions = CliArgs & { | ||
}; | ||
export { CliArgs, BundleOptions, PackageMetadata, BuncheeRollupConfig, }; | ||
export type { CliArgs, BundleOptions, PackageMetadata, BuncheeRollupConfig, }; |
@@ -1,2 +0,2 @@ | ||
import { PackageMetadata } from "./types"; | ||
import type { PackageMetadata } from "./types"; | ||
export declare function getPackageMeta(): PackageMetadata; | ||
@@ -15,2 +15,3 @@ export declare function resolvePackagePath(pathname: string): string; | ||
target: any; | ||
external: any; | ||
}; | ||
@@ -17,0 +18,0 @@ export declare const logger: { |
{ | ||
"name": "bunchee", | ||
"version": "1.8.5", | ||
"version": "1.9.0", | ||
"description": "zero config bundler for js/ts/jsx libraries", | ||
@@ -15,4 +15,4 @@ "bin": { | ||
"prepublishOnly": "yarn clean && yarn build && chmod +x dist/cli.js && yarn test", | ||
"build:cli": "ts-node --files src/cli.ts src/cli.ts --target node -f cjs -o dist/cli.js", | ||
"build:main": "ts-node --files src/cli.ts src/index.ts --target node -f cjs", | ||
"build:cli": "tsx src/cli.ts src/cli.ts --target node -f cjs -o dist/cli.js", | ||
"build:main": "tsx src/cli.ts src/index.ts --target node -f cjs", | ||
"build": "yarn build:main && yarn build:cli" | ||
@@ -58,7 +58,6 @@ }, | ||
"devDependencies": { | ||
"@types/node": "17.0.35", | ||
"jest": "27.0.6", | ||
"ts-node": "10.0.0", | ||
"typescript": "4.3.5" | ||
"tsx": "3.4.3", | ||
"typescript": "4.7.4" | ||
} | ||
} |
# bunchee | ||
> zero config bundler for JavaScript/TypeScript/JSX library | ||
![bunchee](https://user-images.githubusercontent.com/4800338/98430015-7ce64f00-20e5-11eb-8c64-41addfbd4ede.png) | ||
![bunchee](https://user-images.githubusercontent.com/4800338/98430015-7ce64f00-20e5-11eb-8c64-41addfbd4ede.png) | ||
@@ -10,3 +10,3 @@ <p align="left"> | ||
</a> | ||
<a href="https://github.com/huozhi/bunchee/actions?workflow=CI"> | ||
@@ -76,2 +76,3 @@ <img src="https://github.com/huozhi/bunchee/workflows/CI/badge.svg"> | ||
-f, --format <format> specify bundle type: "esm", "cjs", "umd". "esm" by default | ||
-e, --external <mod> specify an external dependency | ||
-h, --help output usage information | ||
@@ -78,0 +79,0 @@ --target <target> build environment, use "node" for nodejs runtime |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
55653
3
505
114