@vcmap/ui 5.1.0-rc.4 → 5.1.1

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.
@@ -390,7 +390,7 @@ export async function buildPluginsForPreview(baseConfig = {}, minify = true) {
390
390
 
391
391
  export async function buildPluginsForBundle(baseConfig = {}) {
392
392
  const inlinePlugins = await getInlinePlugins();
393
- const dependentPlugins = await getPluginNames(true);
393
+ const dependentPlugins = await getPluginNames(false);
394
394
  const promises = inlinePlugins
395
395
  .filter((plugin) => plugin.startsWith('@vcmap/'))
396
396
  .map((plugin) => buildInlinePlugin(plugin, baseConfig, true));
@@ -1,11 +1,20 @@
1
1
  /* eslint import/no-extraneous-dependencies: ["error", { "devDependencies": false }] */
2
- import path from 'path';
2
+ import path from 'node:path';
3
+ import { existsSync } from 'node:fs';
3
4
  import {
4
5
  getInlinePlugins,
5
6
  getPluginDirectory,
6
7
  getPluginNames,
7
8
  } from './buildHelpers.js';
8
9
 
10
+ async function getTsPlugins(pluginsDir, plugins) {
11
+ return plugins.filter((plugin) =>
12
+ existsSync(
13
+ path.join(pluginsDir, 'node_modules', plugin, 'src', 'index.ts'),
14
+ ),
15
+ );
16
+ }
17
+
9
18
  /**
10
19
  * Determines the proxy setting to serve plugins referrenced in the package.json in the plugins directory
11
20
  * @param {string} [target=http://localhost:8080]
@@ -19,14 +28,19 @@ export default async function getPluginProxies(
19
28
  const root = process.cwd();
20
29
  const pluginsDir = getPluginDirectory();
21
30
  const plugins = await getPluginNames();
31
+ const tsPlugins = await getTsPlugins(pluginsDir, plugins);
22
32
  const proxies = {};
23
33
 
24
34
  plugins.forEach((plugin) => {
35
+ const indexJs = tsPlugins.includes(plugin) ? 'index.ts' : 'index.js';
25
36
  proxies[`^/plugins/${plugin}/.*`] = {
26
37
  target,
27
38
  rewrite: (route) => {
28
39
  const rest = route.replace(new RegExp(`^/plugins/${plugin}/`), '');
29
- const file = rest || 'index.js';
40
+ let file = rest || indexJs;
41
+ if (file === 'index.js' && tsPlugins.includes(plugin)) {
42
+ file = indexJs;
43
+ }
30
44
  const pluginDir = path.posix.join(
31
45
  path.relative(root, pluginsDir),
32
46
  'node_modules',
@@ -1 +1 @@
1
- export * from "./cesium.1bcede.js";
1
+ export * from "./cesium.c1accb.js";