@rollup/plugin-commonjs 19.0.2 → 20.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @rollup/plugin-commonjs ChangeLog
2
2
 
3
+ ## v20.0.0
4
+
5
+ _2021-07-30_
6
+
7
+ ### Breaking Changes
8
+
9
+ - fix: Correctly infer module name for any separator (#924)
10
+
3
11
  ## v19.0.2
4
12
 
5
13
  _2021-07-26_
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { basename, extname, dirname, sep, join, resolve } from 'path';
1
+ import { basename, extname, dirname, join, resolve, sep } from 'path';
2
2
  import { makeLegalIdentifier, attachScopes, extractAssignedNames, createFilter } from '@rollup/pluginutils';
3
3
  import getCommonDir from 'commondir';
4
4
  import { existsSync, readFileSync, statSync } from 'fs';
@@ -366,8 +366,7 @@ function getName(id) {
366
366
  if (name !== 'index') {
367
367
  return name;
368
368
  }
369
- const segments = dirname(id).split(sep);
370
- return makeLegalIdentifier(segments[segments.length - 1]);
369
+ return makeLegalIdentifier(basename(dirname(id)));
371
370
  }
372
371
 
373
372
  function normalizePathSlashes(path) {