bunchee 6.5.0 → 6.5.2
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/dist/bin/cli.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -6
- package/package.json +6 -6
package/dist/bin/cli.js
CHANGED
|
@@ -646,7 +646,7 @@ function lint$1(pkg) {
|
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
-
var version = "6.5.
|
|
649
|
+
var version = "6.5.2";
|
|
650
650
|
|
|
651
651
|
async function writeDefaultTsconfig(tsConfigPath) {
|
|
652
652
|
await fs.promises.writeFile(tsConfigPath, JSON.stringify(DEFAULT_TS_CONFIG, null, 2), 'utf-8');
|
package/dist/index.d.ts
CHANGED
|
@@ -47,4 +47,5 @@ type BrowserslistConfig = string | string[] | Record<string, string>;
|
|
|
47
47
|
|
|
48
48
|
declare function bundle(cliEntryPath: string, { cwd: _cwd, onSuccess, ...options }?: BundleConfig): Promise<void>;
|
|
49
49
|
|
|
50
|
-
export {
|
|
50
|
+
export { bundle };
|
|
51
|
+
export type { BundleConfig };
|
package/dist/index.js
CHANGED
|
@@ -1865,9 +1865,12 @@ async function createAssetRollupJobs(options, buildContext, bundleJobOptions) {
|
|
|
1865
1865
|
isFromCli
|
|
1866
1866
|
}) : [];
|
|
1867
1867
|
const allConfigs = assetsConfigs.concat(typesConfigs);
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1868
|
+
// When it's production build (non watch mode), we need to remove the output directory
|
|
1869
|
+
if (!options.watch) {
|
|
1870
|
+
for (const config of allConfigs){
|
|
1871
|
+
if (options.clean && !isFromCli) {
|
|
1872
|
+
await removeOutputDir(config.output, buildContext.cwd);
|
|
1873
|
+
}
|
|
1871
1874
|
}
|
|
1872
1875
|
}
|
|
1873
1876
|
const rollupJobs = allConfigs.map((rollupConfig)=>bundleOrWatch(options, rollupConfig));
|
|
@@ -1978,9 +1981,11 @@ async function bundle(cliEntryPath, { cwd: _cwd, onSuccess, ...options } = {}) {
|
|
|
1978
1981
|
const err = new Error(`Entry file "${cliEntryPath}" does not exist`);
|
|
1979
1982
|
err.name = 'NOT_EXISTED';
|
|
1980
1983
|
return Promise.reject(err);
|
|
1981
|
-
} else
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
+
} else {
|
|
1985
|
+
// Check if the project directory exists
|
|
1986
|
+
const hasProjectDir = cwd && fs__default.default.existsSync(cwd) && (await fsp__default.default.stat(cwd)).isDirectory();
|
|
1987
|
+
// Error if the project directory does not exist
|
|
1988
|
+
if (cwd && !hasProjectDir) {
|
|
1984
1989
|
const err = new Error(`Project directory "${cwd}" does not exist`);
|
|
1985
1990
|
err.name = 'NOT_EXISTED';
|
|
1986
1991
|
return Promise.reject(err);
|
|
@@ -1988,6 +1993,13 @@ async function bundle(cliEntryPath, { cwd: _cwd, onSuccess, ...options } = {}) {
|
|
|
1988
1993
|
}
|
|
1989
1994
|
}
|
|
1990
1995
|
const entries = await collectEntriesFromParsedExports(cwd, parsedExportsInfo, pkg, inputFile);
|
|
1996
|
+
// Collect and log missing entries for defined exports
|
|
1997
|
+
const missingEntries = [
|
|
1998
|
+
...parsedExportsInfo.keys()
|
|
1999
|
+
].filter((key)=>!entries[key] && key !== './package.json');
|
|
2000
|
+
if (missingEntries.length > 0) {
|
|
2001
|
+
logger.warn(`The following exports are defined in package.json but missing source files:\n${missingEntries.map((name)=>`⨯ ${name}`).join('\n')}\n`);
|
|
2002
|
+
}
|
|
1991
2003
|
const hasTypeScriptFiles = Object.values(entries).some((entry)=>isTypescriptFile(entry.source));
|
|
1992
2004
|
// If there's no tsconfig, create one.
|
|
1993
2005
|
if (hasTypeScriptFiles && !hasTsConfig) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunchee",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.2",
|
|
4
4
|
"description": "zero config bundler for js/ts/jsx libraries",
|
|
5
5
|
"bin": "./dist/bin/cli.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
40
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
41
41
|
"@rollup/plugin-json": "^6.1.0",
|
|
42
|
-
"@rollup/plugin-node-resolve": "^16.0.
|
|
42
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
43
43
|
"@rollup/plugin-replace": "^6.0.2",
|
|
44
44
|
"@rollup/plugin-wasm": "^6.2.2",
|
|
45
45
|
"@rollup/pluginutils": "^5.1.4",
|
|
46
|
-
"@swc/core": "^1.
|
|
46
|
+
"@swc/core": "^1.11.21",
|
|
47
47
|
"@swc/helpers": "^0.5.15",
|
|
48
48
|
"clean-css": "^5.3.3",
|
|
49
49
|
"fast-glob": "^3.3.3",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"ora": "^8.0.1",
|
|
52
52
|
"picomatch": "^4.0.2",
|
|
53
53
|
"pretty-bytes": "^5.6.0",
|
|
54
|
-
"rollup": "^4.
|
|
55
|
-
"rollup-plugin-dts": "^6.
|
|
54
|
+
"rollup": "^4.40.0",
|
|
55
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
56
56
|
"rollup-plugin-swc3": "^0.11.1",
|
|
57
57
|
"rollup-preserve-directives": "^1.1.3",
|
|
58
58
|
"tslib": "^2.8.1",
|