@vanilla-extract/vite-plugin 3.1.5 → 3.1.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.
@@ -76,6 +76,7 @@ function vanillaExtractPlugin({
76
76
  let postCssConfig;
77
77
  const cssMap = new Map();
78
78
  let virtualExt;
79
+ let packageName;
79
80
  return {
80
81
  name: 'vanilla-extract',
81
82
  enforce: 'pre',
@@ -98,6 +99,7 @@ function vanillaExtractPlugin({
98
99
 
99
100
  async configResolved(resolvedConfig) {
100
101
  config = resolvedConfig;
102
+ packageName = integration.getPackageInfo(config.root).name;
101
103
 
102
104
  if (config.command === 'serve') {
103
105
  postCssConfig = await resolvePostcssConfig(config);
@@ -172,7 +174,8 @@ function vanillaExtractPlugin({
172
174
  return integration.addFileScope({
173
175
  source: code,
174
176
  filePath: vite.normalizePath(validId),
175
- rootPath: config.root
177
+ rootPath: config.root,
178
+ packageName
176
179
  });
177
180
  }
178
181
 
@@ -76,6 +76,7 @@ function vanillaExtractPlugin({
76
76
  let postCssConfig;
77
77
  const cssMap = new Map();
78
78
  let virtualExt;
79
+ let packageName;
79
80
  return {
80
81
  name: 'vanilla-extract',
81
82
  enforce: 'pre',
@@ -98,6 +99,7 @@ function vanillaExtractPlugin({
98
99
 
99
100
  async configResolved(resolvedConfig) {
100
101
  config = resolvedConfig;
102
+ packageName = integration.getPackageInfo(config.root).name;
101
103
 
102
104
  if (config.command === 'serve') {
103
105
  postCssConfig = await resolvePostcssConfig(config);
@@ -172,7 +174,8 @@ function vanillaExtractPlugin({
172
174
  return integration.addFileScope({
173
175
  source: code,
174
176
  filePath: vite.normalizePath(validId),
175
- rootPath: config.root
177
+ rootPath: config.root,
178
+ packageName
176
179
  });
177
180
  }
178
181
 
@@ -1,7 +1,7 @@
1
1
  import path from 'path';
2
2
  import { normalizePath } from 'vite';
3
3
  import outdent from 'outdent';
4
- import { cssFileFilter, addFileScope, compile, processVanillaFile } from '@vanilla-extract/integration';
4
+ import { getPackageInfo, cssFileFilter, addFileScope, compile, processVanillaFile } from '@vanilla-extract/integration';
5
5
 
6
6
  // Mostly copied from vite's implementation
7
7
  // https://github.com/vitejs/vite/blob/efec70f816b80e55b64255b32a5f120e1cf4e4be/packages/vite/src/node/plugins/css.ts
@@ -49,6 +49,7 @@ function vanillaExtractPlugin({
49
49
  let postCssConfig;
50
50
  const cssMap = new Map();
51
51
  let virtualExt;
52
+ let packageName;
52
53
  return {
53
54
  name: 'vanilla-extract',
54
55
  enforce: 'pre',
@@ -71,6 +72,7 @@ function vanillaExtractPlugin({
71
72
 
72
73
  async configResolved(resolvedConfig) {
73
74
  config = resolvedConfig;
75
+ packageName = getPackageInfo(config.root).name;
74
76
 
75
77
  if (config.command === 'serve') {
76
78
  postCssConfig = await resolvePostcssConfig(config);
@@ -145,7 +147,8 @@ function vanillaExtractPlugin({
145
147
  return addFileScope({
146
148
  source: code,
147
149
  filePath: normalizePath(validId),
148
- rootPath: config.root
150
+ rootPath: config.root,
151
+ packageName
149
152
  });
150
153
  }
151
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/vite-plugin",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
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",
@@ -15,7 +15,7 @@
15
15
  "author": "SEEK",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@vanilla-extract/integration": "^4.0.0",
18
+ "@vanilla-extract/integration": "^4.0.1",
19
19
  "outdent": "^0.8.0",
20
20
  "postcss": "^8.3.6",
21
21
  "postcss-load-config": "^3.1.0"