@docsector/docsector-reader 0.2.4 → 0.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docsector/docsector-reader",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "A documentation rendering engine built with Vue 3, Quasar v2 and Vite. Transform Markdown into beautiful, navigable documentation sites.",
5
5
  "productName": "Docsector Reader",
6
6
  "author": "Rodrigo de Araujo Vieira",
@@ -162,6 +162,24 @@ export function createQuasarConfig (options = {}) {
162
162
  'vue', 'vue-router', 'vuex', 'vue-i18n', 'quasar', '@quasar/extras'
163
163
  ]
164
164
 
165
+ // Force Vite to pre-bundle Vue ecosystem packages.
166
+ // Vite's dep scanner only discovers bare imports from source files,
167
+ // not from .vue files inside node_modules. Without this, vue-router,
168
+ // vuex and vue-i18n are served as raw ESM modules while the router
169
+ // entry (which IS pre-bundled) gets its OWN copy of these libraries
170
+ // baked into its chunk — creating two separate JS module instances
171
+ // with different Symbols. This breaks inject/provide: useRoute(),
172
+ // useStore(), useI18n() all return undefined.
173
+ // CJS packages (prismjs, markdown-it, etc.) also need explicit
174
+ // inclusion to be properly converted to ESM by Vite's optimizer.
175
+ viteConf.optimizeDeps = viteConf.optimizeDeps || {}
176
+ viteConf.optimizeDeps.include = [
177
+ ...(viteConf.optimizeDeps.include || []),
178
+ 'vue', 'vue-router', 'vuex', 'vue-i18n',
179
+ 'prismjs', 'markdown-it', 'markdown-it-attrs',
180
+ 'hjson', 'q-colorize-mixin'
181
+ ]
182
+
165
183
  if (!isStandalone) {
166
184
  // --- Consumer project mode ---
167
185
  // Allow Vite to serve files from the package root (needed for symlinked/npm-linked packages)