@adonisjs/vite 2.0.0 → 2.0.1

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.
@@ -151,10 +151,9 @@ export class Vite {
151
151
  tag: this.#generateTag(chunk.file, { ...attributes, integrity: chunk.integrity }),
152
152
  });
153
153
  for (const css of chunk.css || []) {
154
- const cssChunk = this.#chunkByFile(manifest, css);
155
154
  tags.push({
156
- path: cssChunk.file,
157
- tag: this.#generateTag(cssChunk.file, { ...attributes, integrity: cssChunk.integrity }),
155
+ path: css,
156
+ tag: this.#generateTag(css),
158
157
  });
159
158
  }
160
159
  }
@@ -172,16 +171,6 @@ export class Vite {
172
171
  }
173
172
  return chunk;
174
173
  }
175
- /**
176
- * Get a chunk from the manifest file for a given hashed file name
177
- */
178
- #chunkByFile(manifest, fileName) {
179
- const chunk = Object.values(manifest).find((c) => c.file === fileName);
180
- if (!chunk) {
181
- throw new Error(`Cannot find "${fileName}" chunk in the manifest file`);
182
- }
183
- return chunk;
184
- }
185
174
  /**
186
175
  * Check if the given path is a CSS path
187
176
  */
@@ -11,6 +11,12 @@ const viteBackendConfig = defineConfig({
11
11
  */
12
12
  buildDirectory: 'public/assets',
13
13
 
14
+ /**
15
+ * The path to the manifest file generated by the
16
+ * "vite build" command.
17
+ */
18
+ manifestFile: 'public/assets/.vite/manifest.json',
19
+
14
20
  /**
15
21
  * Feel free to change the value of the "assetsUrl" to
16
22
  * point to a CDN in production.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/vite",
3
3
  "description": "Vite plugin for Adonis.js",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },