@vanilla-extract/vite-plugin 5.2.3 → 5.2.4

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.
@@ -299,17 +299,21 @@ function vanillaExtractPlugin({
299
299
  });
300
300
  },
301
301
  resolveId(source) {
302
- var _compiler4;
303
302
  const [validId, query] = source.split('?');
304
303
  if (!isVirtualId(validId)) return;
305
304
  const absoluteId = getAbsoluteId({
306
305
  filePath: validId,
307
306
  root: config.root
308
307
  });
309
- if ( // We should always have CSS for a file here.
310
- // The only valid scenario for a missing one is if someone had written
311
- // a file in their app using the .vanilla.js/.vanilla.css extension
312
- (_compiler4 = compiler$1) !== null && _compiler4 !== void 0 && _compiler4.getCssForFile(virtualIdToFileId(absoluteId))) {
308
+ if (!compiler$1) return;
309
+
310
+ // The only valid scenario for a missing CSS entry is if someone had
311
+ // written a file in their app using the .vanilla.js/.vanilla.css
312
+ // extension, or the file produced no CSS output.
313
+ const {
314
+ css
315
+ } = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
316
+ if (css) {
313
317
  // Keep the original query string for HMR.
314
318
  return absoluteId + (query ? `?${query}` : '');
315
319
  }
@@ -324,7 +328,9 @@ function vanillaExtractPlugin({
324
328
  const {
325
329
  css
326
330
  } = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
327
- return css;
331
+ if (css) {
332
+ return css;
333
+ }
328
334
  }
329
335
  }];
330
336
  }
@@ -299,17 +299,21 @@ function vanillaExtractPlugin({
299
299
  });
300
300
  },
301
301
  resolveId(source) {
302
- var _compiler4;
303
302
  const [validId, query] = source.split('?');
304
303
  if (!isVirtualId(validId)) return;
305
304
  const absoluteId = getAbsoluteId({
306
305
  filePath: validId,
307
306
  root: config.root
308
307
  });
309
- if ( // We should always have CSS for a file here.
310
- // The only valid scenario for a missing one is if someone had written
311
- // a file in their app using the .vanilla.js/.vanilla.css extension
312
- (_compiler4 = compiler$1) !== null && _compiler4 !== void 0 && _compiler4.getCssForFile(virtualIdToFileId(absoluteId))) {
308
+ if (!compiler$1) return;
309
+
310
+ // The only valid scenario for a missing CSS entry is if someone had
311
+ // written a file in their app using the .vanilla.js/.vanilla.css
312
+ // extension, or the file produced no CSS output.
313
+ const {
314
+ css
315
+ } = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
316
+ if (css) {
313
317
  // Keep the original query string for HMR.
314
318
  return absoluteId + (query ? `?${query}` : '');
315
319
  }
@@ -324,7 +328,9 @@ function vanillaExtractPlugin({
324
328
  const {
325
329
  css
326
330
  } = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
327
- return css;
331
+ if (css) {
332
+ return css;
333
+ }
328
334
  }
329
335
  }];
330
336
  }
@@ -295,17 +295,21 @@ function vanillaExtractPlugin({
295
295
  });
296
296
  },
297
297
  resolveId(source) {
298
- var _compiler4;
299
298
  const [validId, query] = source.split('?');
300
299
  if (!isVirtualId(validId)) return;
301
300
  const absoluteId = getAbsoluteId({
302
301
  filePath: validId,
303
302
  root: config.root
304
303
  });
305
- if ( // We should always have CSS for a file here.
306
- // The only valid scenario for a missing one is if someone had written
307
- // a file in their app using the .vanilla.js/.vanilla.css extension
308
- (_compiler4 = compiler) !== null && _compiler4 !== void 0 && _compiler4.getCssForFile(virtualIdToFileId(absoluteId))) {
304
+ if (!compiler) return;
305
+
306
+ // The only valid scenario for a missing CSS entry is if someone had
307
+ // written a file in their app using the .vanilla.js/.vanilla.css
308
+ // extension, or the file produced no CSS output.
309
+ const {
310
+ css
311
+ } = compiler.getCssForFile(virtualIdToFileId(absoluteId));
312
+ if (css) {
309
313
  // Keep the original query string for HMR.
310
314
  return absoluteId + (query ? `?${query}` : '');
311
315
  }
@@ -320,7 +324,9 @@ function vanillaExtractPlugin({
320
324
  const {
321
325
  css
322
326
  } = compiler.getCssForFile(virtualIdToFileId(absoluteId));
323
- return css;
327
+ if (css) {
328
+ return css;
329
+ }
324
330
  }
325
331
  }];
326
332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/vite-plugin",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "description": "Zero-runtime Stylesheets-in-TypeScript",
5
5
  "main": "dist/vanilla-extract-vite-plugin.cjs.js",
6
6
  "module": "dist/vanilla-extract-vite-plugin.esm.js",
@@ -16,8 +16,8 @@
16
16
  "author": "SEEK",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@vanilla-extract/integration": "^8.0.10",
20
- "@vanilla-extract/compiler": "^0.7.0"
19
+ "@vanilla-extract/compiler": "^0.7.1",
20
+ "@vanilla-extract/integration": "^8.0.10"
21
21
  },
22
22
  "devDependencies": {
23
23
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"