@vcmap/plugin-cli 2.1.14 → 2.1.16
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/serve.js +25 -9
package/package.json
CHANGED
package/src/serve.js
CHANGED
|
@@ -107,6 +107,24 @@ export default async function serve(options) {
|
|
|
107
107
|
const proxy = await getProxy(mergedOptions.https ? 'https' : 'http', port);
|
|
108
108
|
const { peerDependencies } = await getPackageJson();
|
|
109
109
|
|
|
110
|
+
const optimizationIncludes = [
|
|
111
|
+
'fast-deep-equal',
|
|
112
|
+
'rbush',
|
|
113
|
+
'rbush-knn',
|
|
114
|
+
'pbf',
|
|
115
|
+
'semver',
|
|
116
|
+
'@vcmap-cesium/engine',
|
|
117
|
+
'vue',
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
// We exclude ui dependencies from optimization, to allow plugins to use another version of the same plugin.
|
|
121
|
+
// vitejs seems to have a problem with optimized deps in different versions.
|
|
122
|
+
const { dependencies } = await getPackageJson(resolveMapUi());
|
|
123
|
+
|
|
124
|
+
const excludedOptimizations = Object.keys(dependencies).filter(
|
|
125
|
+
(name) => !optimizationIncludes.includes(name),
|
|
126
|
+
);
|
|
127
|
+
|
|
110
128
|
const server = await createServer({
|
|
111
129
|
root: getContext(),
|
|
112
130
|
publicDir: './node_modules/@vcmap/ui/public',
|
|
@@ -118,16 +136,14 @@ export default async function serve(options) {
|
|
|
118
136
|
dedupe: Object.keys(peerDependencies),
|
|
119
137
|
},
|
|
120
138
|
optimizeDeps: {
|
|
121
|
-
exclude: [
|
|
122
|
-
|
|
123
|
-
'
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
|
|
127
|
-
'semver',
|
|
128
|
-
'@vcmap-cesium/engine',
|
|
129
|
-
'vue',
|
|
139
|
+
exclude: [
|
|
140
|
+
'@vcmap/ui',
|
|
141
|
+
'@vcmap/core',
|
|
142
|
+
'ol',
|
|
143
|
+
'proj4',
|
|
144
|
+
...excludedOptimizations,
|
|
130
145
|
],
|
|
146
|
+
include: optimizationIncludes,
|
|
131
147
|
},
|
|
132
148
|
plugins: [vue2(), createConfigJsonReloadPlugin()],
|
|
133
149
|
server: {
|