vite-plugin-dts 3.5.3 → 3.5.4

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/index.cjs CHANGED
@@ -626,11 +626,17 @@ ${logPrefix} ${kolorist.yellow(
626
626
  });
627
627
  }
628
628
  }
629
- include = ensureArray(options.include ?? content?.raw.include ?? "**/*").map(normalizeGlob);
630
- exclude = ensureArray(options.exclude ?? content?.raw.exclude ?? "node_modules/**").map(
631
- normalizeGlob
632
- );
633
- filter = pluginutils.createFilter(include, exclude, { resolve: root });
629
+ const computeGlobs = (rootGlobs, tsGlobs, defaultGlob) => {
630
+ if (rootGlobs?.length) {
631
+ return ensureArray(rootGlobs).map((glob) => normalizeGlob(ensureAbsolute(glob, root)));
632
+ }
633
+ return ensureArray(tsGlobs?.length ? tsGlobs : defaultGlob).map(
634
+ (glob) => normalizeGlob(ensureAbsolute(glob, configPath ? node_path.dirname(configPath) : root))
635
+ );
636
+ };
637
+ include = computeGlobs(options.include, content?.raw.include, "**/*");
638
+ exclude = computeGlobs(options.exclude, content?.raw.exclude, "node_modules/**");
639
+ filter = pluginutils.createFilter(include, exclude);
634
640
  const rootNames = Object.values(entries).map((entry) => ensureAbsolute(entry, root)).concat(content?.fileNames.filter(filter) || []).map(normalizePath);
635
641
  host = ts__default.createCompilerHost(compilerOptions, true);
636
642
  program = vueTsc.createProgram({ host, rootNames, options: compilerOptions });
package/dist/index.d.ts CHANGED
@@ -115,9 +115,9 @@ interface PluginOptions {
115
115
  */
116
116
  staticImport?: boolean;
117
117
  /**
118
- * Override `include` glob
118
+ * Override `include` glob (relative to root)
119
119
  *
120
- * Defaults to `include` property of tsconfig.json
120
+ * Defaults to `include` property of tsconfig.json (relative to tsconfig.json located)
121
121
  */
122
122
  include?: string | string[];
123
123
  /**
package/dist/index.mjs CHANGED
@@ -626,11 +626,17 @@ ${logPrefix} ${yellow(
626
626
  });
627
627
  }
628
628
  }
629
- include = ensureArray(options.include ?? content?.raw.include ?? "**/*").map(normalizeGlob);
630
- exclude = ensureArray(options.exclude ?? content?.raw.exclude ?? "node_modules/**").map(
631
- normalizeGlob
632
- );
633
- filter = createFilter(include, exclude, { resolve: root });
629
+ const computeGlobs = (rootGlobs, tsGlobs, defaultGlob) => {
630
+ if (rootGlobs?.length) {
631
+ return ensureArray(rootGlobs).map((glob) => normalizeGlob(ensureAbsolute(glob, root)));
632
+ }
633
+ return ensureArray(tsGlobs?.length ? tsGlobs : defaultGlob).map(
634
+ (glob) => normalizeGlob(ensureAbsolute(glob, configPath ? dirname(configPath) : root))
635
+ );
636
+ };
637
+ include = computeGlobs(options.include, content?.raw.include, "**/*");
638
+ exclude = computeGlobs(options.exclude, content?.raw.exclude, "node_modules/**");
639
+ filter = createFilter(include, exclude);
634
640
  const rootNames = Object.values(entries).map((entry) => ensureAbsolute(entry, root)).concat(content?.fileNames.filter(filter) || []).map(normalizePath);
635
641
  host = ts.createCompilerHost(compilerOptions, true);
636
642
  program = createProgram({ host, rootNames, options: compilerOptions });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-dts",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "qmhc",