@vcmap/plugin-cli 2.1.16 → 2.1.17

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/package.json +1 -1
  2. package/src/serve.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/plugin-cli",
3
- "version": "2.1.16",
3
+ "version": "2.1.17",
4
4
  "description": "A CLI to help develop and build plugins for the VC Map",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/serve.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import fs from 'fs';
2
+ import { readFile } from 'fs/promises';
2
3
  import { createServer } from 'vite';
3
4
  import vue2 from '@vitejs/plugin-vue2';
4
5
  import express from 'express';
@@ -119,7 +120,10 @@ export default async function serve(options) {
119
120
 
120
121
  // We exclude ui dependencies from optimization, to allow plugins to use another version of the same plugin.
121
122
  // vitejs seems to have a problem with optimized deps in different versions.
122
- const { dependencies } = await getPackageJson(resolveMapUi());
123
+ const uiPackageJsonPath = path.join(resolveMapUi(), 'package.json');
124
+ const { dependencies } = JSON.parse(
125
+ (await readFile(uiPackageJsonPath)).toString(),
126
+ );
123
127
 
124
128
  const excludedOptimizations = Object.keys(dependencies).filter(
125
129
  (name) => !optimizationIncludes.includes(name),