@despia/local 1.0.5 → 1.0.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": "@despia/local",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Universal build plugin to generate despia/local.json manifest for offline caching in Despia web-native apps. Supports Vite, Webpack, Rollup, Nuxt, SvelteKit, Astro, Remix, esbuild, Parcel, and more.",
5
5
  "type": "module",
6
6
  "main": "./src/core.js",
package/src/core.js CHANGED
@@ -87,9 +87,9 @@ export function generateManifest({ outputDir, entryHtml = 'index.html', addition
87
87
  assetPaths.add(entryPath);
88
88
  }
89
89
 
90
- // Separate entry from other assets
90
+ // Include all assets (entry is included in assets array)
91
91
  const assets = Array.from(assetPaths)
92
- .filter(path => path !== entryPath || skipEntryHtml)
92
+ .filter(path => !skipEntryHtml || path !== entryPath)
93
93
  .sort();
94
94
 
95
95
  // Create manifest object (entry is always required for local client-side apps)
package/src/webpack.js CHANGED
@@ -93,13 +93,19 @@ class DespiaLocalPlugin {
93
93
  this.scanPublicDir(this.options.publicDir, this.options.publicDir, assets);
94
94
  }
95
95
 
96
- // 3. Separate entry from other assets and generate object format
96
+ // 3. Generate object format (entry is included in assets array)
97
97
  // Entry is always required for local client-side apps
98
98
  const entryPath = this.options.entryHtml.startsWith('/')
99
99
  ? this.options.entryHtml
100
100
  : '/' + this.options.entryHtml;
101
+
102
+ // Ensure entry is in assets if not skipped
103
+ if (!this.options.skipEntryHtml) {
104
+ assets.add(entryPath);
105
+ }
106
+
101
107
  const assetList = Array.from(assets)
102
- .filter(path => path !== entryPath || this.options.skipEntryHtml)
108
+ .filter(path => !this.options.skipEntryHtml || path !== entryPath)
103
109
  .sort();
104
110
 
105
111
  const manifestObj = {