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 CHANGED
@@ -27,7 +27,7 @@ var logger = {
27
27
  }
28
28
  };
29
29
 
30
- var version = "2.1.6";
30
+ var version = "2.1.7";
31
31
 
32
32
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
33
33
  try {
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 useEsModuleMark = Boolean(tsCompilerOptions.esModuleInterop || exportPaths.main && exportPaths.module);
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, "./").options;
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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": {
6
6
  "bunchee": "./dist/cli.js"