@package-verse/esmpack 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@package-verse/esmpack",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "ESM Pack Packer and Web Server with PostCSS and ESM Loader",
5
5
  "homepage": "https://github.com/package-verse/esmpack#readme",
6
6
  "bugs": {
@@ -17,14 +17,18 @@ for (const [key] of Object.entries(packageInfo.dependencies)) {
17
17
  continue;
18
18
  }
19
19
 
20
- const modulePath = "/node_modules/" + key + "/";
20
+ let modulePath = "/node_modules/" + key + "/";
21
21
 
22
22
  // read package.json
23
23
  const modulePackageJson = JSON.parse(readFileSync(modulePackageJsonFilePath, "utf-8"));
24
+
24
25
  imports[key] = path.join(modulePath , modulePackageJson.module
25
26
  || (modulePackageJson.type === "module"
26
27
  ? modulePackageJson.main : "index.js"));
27
28
 
29
+ if (modulePackageJson.esm) {
30
+ modulePath += modulePackageJson.esm + "/";
31
+ }
28
32
  imports[key + "/"] = modulePath;
29
33
 
30
34
  }