vite-plugin-lib 2.0.0 → 2.0.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -3
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -164,6 +164,7 @@ function buildConfig({
164
164
  external: externalPackages ?? [
165
165
  /node_modules/,
166
166
  ...builtinModules,
167
+ /node:/,
167
168
  ...getDependencies(manifest)
168
169
  ]
169
170
  }
@@ -175,8 +176,8 @@ function buildConfig({
175
176
  function getDependencies(manifest) {
176
177
  try {
177
178
  const content = readFileSync(manifest, { encoding: "utf-8" });
178
- const { dependencies = {} } = JSON.parse(content);
179
- return Object.keys(dependencies);
179
+ const { dependencies = {}, peerDependencies = {} } = JSON.parse(content);
180
+ return Object.keys({ ...dependencies, ...peerDependencies });
180
181
  } catch (error) {
181
182
  const message = getErrorMessage(error);
182
183
  logError(`Could not read ${c.green(manifest)}: ${message}`);
@@ -265,7 +266,10 @@ function library(options = {}) {
265
266
  include: `${path.resolve(mergedOptions.entry, "..")}/**`,
266
267
  outDir: typesDir,
267
268
  staticImport: true,
268
- afterBuild: includesESFormat(options.formats) ? () => generateMTSDeclarations(typesDir, options.formats?.length === 1) : void 0
269
+ afterBuild: includesESFormat(mergedOptions.formats) ? () => generateMTSDeclarations(
270
+ typesDir,
271
+ mergedOptions.formats?.length === 1
272
+ ) : void 0
269
273
  })
270
274
  ];
271
275
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-lib",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Vite plugin for build configuration, automatic aliases, and type declarations.",
5
5
  "author": "Jan Müller <janmueller3698@gmail.com>",
6
6
  "license": "MIT",