@vcmap/plugin-cli 4.1.4 → 4.1.6
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 +1 -1
- package/src/build.js +3 -0
- package/src/pluginCliHelper.js +1 -0
- package/src/serve.js +6 -3
package/package.json
CHANGED
package/src/build.js
CHANGED
package/src/pluginCliHelper.js
CHANGED
|
@@ -30,6 +30,7 @@ export const promiseExec = util.promisify(childProcess.exec);
|
|
|
30
30
|
* @typedef {PreviewOptions} VcmConfigJs
|
|
31
31
|
* @property {Object} [proxy] - see https://vitejs.dev/config/server-options.html#server-proxy. when building a staging app, we try to deduce an .htaccess from it.
|
|
32
32
|
* @property {string} [htaccess] - a string representing an .htaccess file content for use in staging apps.
|
|
33
|
+
* @property {Object} [optimizeDeps] - see https://vite.dev/config/dep-optimization-options
|
|
33
34
|
*/
|
|
34
35
|
|
|
35
36
|
/**
|
package/src/serve.js
CHANGED
|
@@ -130,6 +130,7 @@ export default async function serve(options) {
|
|
|
130
130
|
'@vcmap-cesium/engine',
|
|
131
131
|
'vue',
|
|
132
132
|
'geographiclib-geodesic',
|
|
133
|
+
...(mergedOptions.optimizeDeps?.include || []),
|
|
133
134
|
];
|
|
134
135
|
|
|
135
136
|
// We exclude ui dependencies from optimization, to allow plugins to use another version of the same plugin.
|
|
@@ -139,9 +140,10 @@ export default async function serve(options) {
|
|
|
139
140
|
(await readFile(uiPackageJsonPath)).toString(),
|
|
140
141
|
);
|
|
141
142
|
|
|
142
|
-
const excludedOptimizations =
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
const excludedOptimizations = [
|
|
144
|
+
...Object.keys(dependencies),
|
|
145
|
+
...(mergedOptions.optimizeDeps?.exclude || []),
|
|
146
|
+
].filter((name) => !optimizationIncludes.includes(name));
|
|
145
147
|
|
|
146
148
|
let serverFsConfig;
|
|
147
149
|
const coreModule = join(process.cwd(), 'node_modules', '@vcmap', 'core');
|
|
@@ -175,6 +177,7 @@ export default async function serve(options) {
|
|
|
175
177
|
preserveSymlinks: uiLStat.isSymbolicLink(),
|
|
176
178
|
},
|
|
177
179
|
optimizeDeps: {
|
|
180
|
+
...(mergedOptions.optimizeDeps || {}),
|
|
178
181
|
exclude: [
|
|
179
182
|
'@vcmap/ui',
|
|
180
183
|
'@vcmap/core',
|