@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.
- package/build/src/backend/vite.js +2 -13
- package/build/stubs/config.stub +6 -0
- package/package.json +1 -1
|
@@ -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:
|
|
157
|
-
tag: this.#generateTag(
|
|
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
|
*/
|
package/build/stubs/config.stub
CHANGED
|
@@ -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.
|