semantic-release 20.0.4 → 20.1.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.
@@ -52,14 +52,18 @@ export async function loadPlugin({cwd}, name, pluginsPath) {
52
52
  ? dirname(resolveFrom.silent(__dirname, pluginsPath[name]) || resolveFrom(cwd, pluginsPath[name]))
53
53
  : __dirname;
54
54
 
55
- if (!isFunction(name)) {
56
- const file = resolveFrom.silent(basePath, name) || resolveFrom(cwd, name);
57
- // See https://github.com/mysticatea/eslint-plugin-node/issues/250
58
- // eslint-disable-next-line node/no-unsupported-features/es-syntax
59
- name = (await import(`file://${file}`)).default;
55
+ if (isFunction(name)) {
56
+ return name;
60
57
  }
61
58
 
62
- return name;
59
+ const file = resolveFrom.silent(basePath, name) || resolveFrom(cwd, name);
60
+ const { default: cjsExport, ...esmNamedExports } = await import(`file://${file}`);
61
+
62
+ if (cjsExport) {
63
+ return cjsExport;
64
+ }
65
+
66
+ return esmNamedExports;
63
67
  }
64
68
 
65
69
  export function parseConfig(plugin) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "semantic-release",
3
3
  "description": "Automated semver compliant package publishing",
4
- "version": "20.0.4",
4
+ "version": "20.1.0",
5
5
  "type": "module",
6
6
  "author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
7
7
  "ava": {