@vanilla-extract/vite-plugin
Advanced tools
Comparing version 2.1.1 to 2.1.2
# @vanilla-extract/vite-plugin | ||
## 2.1.2 | ||
### Patch Changes | ||
- [#398](https://github.com/seek-oss/vanilla-extract/pull/398) [`63f4ed0`](https://github.com/seek-oss/vanilla-extract/commit/63f4ed0e67419df565f3f447cf27cec612afbb8d) Thanks [@benjervis](https://github.com/benjervis)! - Fixes a bug with vite where "?used" is appended to the file path of css files. | ||
This could cause different class name hashes to be generated between SSR and client builds. | ||
This was introduced in vite 2.6.0. | ||
## 2.1.1 | ||
@@ -4,0 +13,0 @@ |
@@ -60,6 +60,9 @@ 'use strict'; | ||
const usedIndex = id.indexOf('?used'); | ||
const fixedId = usedIndex > 0 ? id.substring(0, usedIndex) : id; | ||
if (ssr || useRuntime) { | ||
return integration.addFileScope({ | ||
source: code, | ||
filePath: vite.normalizePath(path__default['default'].relative(packageInfo.dirname, id)), | ||
filePath: vite.normalizePath(path__default['default'].relative(packageInfo.dirname, fixedId)), | ||
packageInfo | ||
@@ -73,3 +76,3 @@ }).source; | ||
} = await integration.compile({ | ||
filePath: id, | ||
filePath: fixedId, | ||
cwd: config.root | ||
@@ -84,3 +87,3 @@ }); | ||
source, | ||
filePath: id, | ||
filePath: fixedId, | ||
outputCss: !ssr, | ||
@@ -87,0 +90,0 @@ identOption: identifiers !== null && identifiers !== void 0 ? identifiers : config.mode === 'production' ? 'short' : 'debug' |
@@ -60,6 +60,9 @@ 'use strict'; | ||
const usedIndex = id.indexOf('?used'); | ||
const fixedId = usedIndex > 0 ? id.substring(0, usedIndex) : id; | ||
if (ssr || useRuntime) { | ||
return integration.addFileScope({ | ||
source: code, | ||
filePath: vite.normalizePath(path__default['default'].relative(packageInfo.dirname, id)), | ||
filePath: vite.normalizePath(path__default['default'].relative(packageInfo.dirname, fixedId)), | ||
packageInfo | ||
@@ -73,3 +76,3 @@ }).source; | ||
} = await integration.compile({ | ||
filePath: id, | ||
filePath: fixedId, | ||
cwd: config.root | ||
@@ -84,3 +87,3 @@ }); | ||
source, | ||
filePath: id, | ||
filePath: fixedId, | ||
outputCss: !ssr, | ||
@@ -87,0 +90,0 @@ identOption: identifiers !== null && identifiers !== void 0 ? identifiers : config.mode === 'production' ? 'short' : 'debug' |
@@ -52,6 +52,9 @@ import path from 'path'; | ||
const usedIndex = id.indexOf('?used'); | ||
const fixedId = usedIndex > 0 ? id.substring(0, usedIndex) : id; | ||
if (ssr || useRuntime) { | ||
return addFileScope({ | ||
source: code, | ||
filePath: normalizePath(path.relative(packageInfo.dirname, id)), | ||
filePath: normalizePath(path.relative(packageInfo.dirname, fixedId)), | ||
packageInfo | ||
@@ -65,3 +68,3 @@ }).source; | ||
} = await compile({ | ||
filePath: id, | ||
filePath: fixedId, | ||
cwd: config.root | ||
@@ -76,3 +79,3 @@ }); | ||
source, | ||
filePath: id, | ||
filePath: fixedId, | ||
outputCss: !ssr, | ||
@@ -79,0 +82,0 @@ identOption: identifiers !== null && identifiers !== void 0 ? identifiers : config.mode === 'production' ? 'short' : 'debug' |
{ | ||
"name": "@vanilla-extract/vite-plugin", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/vanilla-extract-vite-plugin.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43711
243