bunchee 2.1.6 → 2.1.7
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/cli.js +1 -1
- package/dist/lib.js +4 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/lib.js
CHANGED
|
@@ -327,7 +327,8 @@ function buildOutputConfigs(options, pkg, param) {
|
|
|
327
327
|
// respect if tsconfig.json has `esModuleInterop` config;
|
|
328
328
|
// add ESModule mark if cjs and ESModule are both generated;
|
|
329
329
|
// TODO: support `import` in exportCondition
|
|
330
|
-
var
|
|
330
|
+
var mainExport = exportPaths["."];
|
|
331
|
+
var useEsModuleMark = Boolean(tsCompilerOptions.esModuleInterop || mainExport.main && mainExport.module);
|
|
331
332
|
var typings = getTypings(pkg);
|
|
332
333
|
var file = options.file && path.resolve(config.rootDir, options.file);
|
|
333
334
|
var dtsDir = typings ? path.dirname(path.resolve(config.rootDir, typings)) : path.resolve(config.rootDir, "dist");
|
|
@@ -366,8 +367,9 @@ function buildConfig(entry, pkg, cliArgs, dtsOnly) {
|
|
|
366
367
|
var ts = resolveTypescript(config.rootDir);
|
|
367
368
|
tsConfigPath = path.resolve(config.rootDir, "tsconfig.json");
|
|
368
369
|
if (fs__default["default"].existsSync(tsConfigPath)) {
|
|
370
|
+
var basePath = tsConfigPath ? path.dirname(tsConfigPath) : config.rootDir;
|
|
369
371
|
var tsconfigJSON = ts.readConfigFile(tsConfigPath, ts.sys.readFile).config;
|
|
370
|
-
tsCompilerOptions = ts.parseJsonConfigFileContent(tsconfigJSON, ts.sys,
|
|
372
|
+
tsCompilerOptions = ts.parseJsonConfigFileContent(tsconfigJSON, ts.sys, basePath).options;
|
|
371
373
|
} else {
|
|
372
374
|
tsConfigPath = undefined;
|
|
373
375
|
exit("tsconfig.json is missing in your project directory");
|