bunchee 5.1.2 → 5.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/bin/cli.js +4 -6
- package/dist/index.js +2 -2
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -162,14 +162,14 @@ Assuming you have default export package as `"."` and subpath export `"./lite"`
|
|
|
162
162
|
{
|
|
163
163
|
"name": "example",
|
|
164
164
|
"scripts": {
|
|
165
|
-
|
|
165
|
+
"build": "bunchee"
|
|
166
166
|
},
|
|
167
167
|
"exports": {
|
|
168
168
|
"./lite": "./dist/lite.js",
|
|
169
169
|
".": {
|
|
170
170
|
"import": "./dist/index.mjs",
|
|
171
171
|
"require": "./dist/index.cjs"
|
|
172
|
-
|
|
172
|
+
}
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
```
|
|
@@ -322,7 +322,6 @@ import { AppContext } from './app-context.shared-runtime'
|
|
|
322
322
|
- Runtime (`--runtime <runtime>`): Set build runtime (default: `'browser'`).
|
|
323
323
|
- Environment (`--env <env,>`): Define environment variables. (default: `NODE_ENV`, separate by comma)
|
|
324
324
|
- Working Directory (`--cwd <cwd>`): Set current working directory where containing `package.json`.
|
|
325
|
-
- Types (`--dts`): Generate TypeScript declaration files along with assets.
|
|
326
325
|
- Minify (`-m`): Compress output.
|
|
327
326
|
- Watch (`-w`): Watch for source file changes.
|
|
328
327
|
- No Clean(`--no-clean`): Do not clean the dist folder before building. (default: `false`)
|
package/dist/bin/cli.js
CHANGED
|
@@ -315,7 +315,7 @@ function addToExportDistMap(exportToDist, exportPath, outputConditionPairs, spec
|
|
|
315
315
|
],
|
|
316
316
|
Boolean(moduleExportPath) && [
|
|
317
317
|
moduleExportPath,
|
|
318
|
-
'
|
|
318
|
+
'module'
|
|
319
319
|
],
|
|
320
320
|
Boolean(typesEntryPath) && [
|
|
321
321
|
typesEntryPath,
|
|
@@ -474,7 +474,7 @@ function lint$1(pkg) {
|
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
var version = "5.1.
|
|
477
|
+
var version = "5.1.4";
|
|
478
478
|
|
|
479
479
|
function relativify(path) {
|
|
480
480
|
return path.startsWith('.') ? path : `./${path}`;
|
|
@@ -866,7 +866,6 @@ Options:
|
|
|
866
866
|
--env <env> inlined process env variables, separate by comma. default: NODE_ENV
|
|
867
867
|
--cwd <cwd> specify current working directory
|
|
868
868
|
--sourcemap enable sourcemap generation, default: false
|
|
869
|
-
--dts determine if need to generate types, default: undefined
|
|
870
869
|
--no-dts do not generate types, default: undefined
|
|
871
870
|
--tsconfig path to tsconfig file, default: tsconfig.json
|
|
872
871
|
`;
|
|
@@ -884,7 +883,6 @@ function parseCliArgs(argv) {
|
|
|
884
883
|
let args;
|
|
885
884
|
args = arg__default.default({
|
|
886
885
|
'--cwd': String,
|
|
887
|
-
'--dts': Boolean,
|
|
888
886
|
'--no-dts': Boolean,
|
|
889
887
|
'--output': String,
|
|
890
888
|
'--format': String,
|
|
@@ -920,7 +918,7 @@ function parseCliArgs(argv) {
|
|
|
920
918
|
minify: args['--minify'],
|
|
921
919
|
sourcemap: !!args['--sourcemap'],
|
|
922
920
|
cwd: args['--cwd'],
|
|
923
|
-
dts: args['--no-dts'] ? false :
|
|
921
|
+
dts: args['--no-dts'] ? false : undefined,
|
|
924
922
|
help: args['--help'],
|
|
925
923
|
version: args['--version'],
|
|
926
924
|
runtime: args['--runtime'],
|
|
@@ -939,7 +937,7 @@ async function run(args) {
|
|
|
939
937
|
const cwd = args.cwd || process.cwd();
|
|
940
938
|
const file = args.file ? path__default.default.resolve(cwd, args.file) : undefined;
|
|
941
939
|
const bundleConfig = {
|
|
942
|
-
dts
|
|
940
|
+
dts,
|
|
943
941
|
file,
|
|
944
942
|
format,
|
|
945
943
|
cwd,
|
package/dist/index.js
CHANGED
|
@@ -761,7 +761,7 @@ function addToExportDistMap(exportToDist, exportPath, outputConditionPairs, spec
|
|
|
761
761
|
],
|
|
762
762
|
Boolean(moduleExportPath) && [
|
|
763
763
|
moduleExportPath,
|
|
764
|
-
'
|
|
764
|
+
'module'
|
|
765
765
|
],
|
|
766
766
|
Boolean(typesEntryPath) && [
|
|
767
767
|
typesEntryPath,
|
|
@@ -1762,7 +1762,7 @@ async function bundle(cliEntryPath, { cwd: _cwd, ...options } = {}) {
|
|
|
1762
1762
|
mainExportPath = options.file;
|
|
1763
1763
|
}
|
|
1764
1764
|
if (mainExportPath) {
|
|
1765
|
-
if (options.dts) {
|
|
1765
|
+
if (options.dts !== false) {
|
|
1766
1766
|
typesEntryPath = getExportFileTypePath(mainExportPath);
|
|
1767
1767
|
}
|
|
1768
1768
|
parsedExportsInfo.set('./index', [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunchee",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "zero config bundler for js/ts/jsx libraries",
|
|
5
5
|
"bin": "./dist/bin/cli.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@rollup/plugin-replace": "^5.0.5",
|
|
43
43
|
"@rollup/plugin-wasm": "^6.2.2",
|
|
44
44
|
"@rollup/pluginutils": "^5.1.0",
|
|
45
|
-
"@swc/core": "^1.4.
|
|
46
|
-
"@swc/helpers": "^0.5.
|
|
45
|
+
"@swc/core": "^1.4.17",
|
|
46
|
+
"@swc/helpers": "^0.5.11",
|
|
47
47
|
"arg": "^5.0.2",
|
|
48
48
|
"clean-css": "^5.3.3",
|
|
49
|
-
"magic-string": "^0.30.
|
|
49
|
+
"magic-string": "^0.30.10",
|
|
50
50
|
"pretty-bytes": "^5.6.0",
|
|
51
|
-
"rollup": "^4.
|
|
51
|
+
"rollup": "^4.17.2",
|
|
52
52
|
"rollup-plugin-dts": "^6.1.0",
|
|
53
|
-
"rollup-plugin-swc3": "^0.11.
|
|
53
|
+
"rollup-plugin-swc3": "^0.11.1",
|
|
54
54
|
"rollup-preserve-directives": "^1.1.1",
|
|
55
55
|
"tslib": "^2.6.2"
|
|
56
56
|
},
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"test": "jest --env node",
|
|
109
109
|
"test:update": "TEST_UPDATE_SNAPSHOT=1 pnpm test",
|
|
110
110
|
"test:post": "POST_BUILD=1 pnpm jest test/compile.test.ts test/integration.test.ts",
|
|
111
|
+
"test:ci": "[ -z $CI ] || pnpm test",
|
|
111
112
|
"clean": "rm -rf ./dist",
|
|
112
113
|
"typecheck": "tsc --noEmit && tsc -p test/tsconfig.json --noEmit",
|
|
113
114
|
"tsx": "node -r @swc-node/register",
|