@vanilla-extract/vite-plugin 4.0.7 → 4.0.8

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.
@@ -114,8 +114,16 @@ function vanillaExtractPlugin({
114
114
  }
115
115
  },
116
116
  buildEnd() {
117
- var _compiler;
118
- (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
117
+ // When using the rollup watcher, we don't want to close the compiler after every build.
118
+ // Instead, we close it when the watcher is closed via the closeWatcher hook.
119
+ if (!config.build.watch) {
120
+ var _compiler;
121
+ (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
122
+ }
123
+ },
124
+ closeWatcher() {
125
+ var _compiler2;
126
+ return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
119
127
  },
120
128
  async transform(code, id) {
121
129
  const [validId] = id.split('?');
@@ -153,14 +161,14 @@ function vanillaExtractPlugin({
153
161
  }
154
162
  },
155
163
  resolveId(source) {
156
- var _compiler2;
164
+ var _compiler3;
157
165
  const [validId, query] = source.split('?');
158
166
  if (!isVirtualId(validId)) return;
159
167
  const absoluteId = getAbsoluteId(validId);
160
168
  if ( // We should always have CSS for a file here.
161
169
  // The only valid scenario for a missing one is if someone had written
162
170
  // a file in their app using the .vanilla.js/.vanilla.css extension
163
- (_compiler2 = compiler) !== null && _compiler2 !== void 0 && _compiler2.getCssForFile(virtualIdToFileId(absoluteId))) {
171
+ (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
164
172
  // Keep the original query string for HMR.
165
173
  return absoluteId + (query ? `?${query}` : '');
166
174
  }
@@ -114,8 +114,16 @@ function vanillaExtractPlugin({
114
114
  }
115
115
  },
116
116
  buildEnd() {
117
- var _compiler;
118
- (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
117
+ // When using the rollup watcher, we don't want to close the compiler after every build.
118
+ // Instead, we close it when the watcher is closed via the closeWatcher hook.
119
+ if (!config.build.watch) {
120
+ var _compiler;
121
+ (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
122
+ }
123
+ },
124
+ closeWatcher() {
125
+ var _compiler2;
126
+ return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
119
127
  },
120
128
  async transform(code, id) {
121
129
  const [validId] = id.split('?');
@@ -153,14 +161,14 @@ function vanillaExtractPlugin({
153
161
  }
154
162
  },
155
163
  resolveId(source) {
156
- var _compiler2;
164
+ var _compiler3;
157
165
  const [validId, query] = source.split('?');
158
166
  if (!isVirtualId(validId)) return;
159
167
  const absoluteId = getAbsoluteId(validId);
160
168
  if ( // We should always have CSS for a file here.
161
169
  // The only valid scenario for a missing one is if someone had written
162
170
  // a file in their app using the .vanilla.js/.vanilla.css extension
163
- (_compiler2 = compiler) !== null && _compiler2 !== void 0 && _compiler2.getCssForFile(virtualIdToFileId(absoluteId))) {
171
+ (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
164
172
  // Keep the original query string for HMR.
165
173
  return absoluteId + (query ? `?${query}` : '');
166
174
  }
@@ -106,8 +106,16 @@ function vanillaExtractPlugin({
106
106
  }
107
107
  },
108
108
  buildEnd() {
109
- var _compiler;
110
- (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
109
+ // When using the rollup watcher, we don't want to close the compiler after every build.
110
+ // Instead, we close it when the watcher is closed via the closeWatcher hook.
111
+ if (!config.build.watch) {
112
+ var _compiler;
113
+ (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
114
+ }
115
+ },
116
+ closeWatcher() {
117
+ var _compiler2;
118
+ return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
111
119
  },
112
120
  async transform(code, id) {
113
121
  const [validId] = id.split('?');
@@ -145,14 +153,14 @@ function vanillaExtractPlugin({
145
153
  }
146
154
  },
147
155
  resolveId(source) {
148
- var _compiler2;
156
+ var _compiler3;
149
157
  const [validId, query] = source.split('?');
150
158
  if (!isVirtualId(validId)) return;
151
159
  const absoluteId = getAbsoluteId(validId);
152
160
  if ( // We should always have CSS for a file here.
153
161
  // The only valid scenario for a missing one is if someone had written
154
162
  // a file in their app using the .vanilla.js/.vanilla.css extension
155
- (_compiler2 = compiler) !== null && _compiler2 !== void 0 && _compiler2.getCssForFile(virtualIdToFileId(absoluteId))) {
163
+ (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
156
164
  // Keep the original query string for HMR.
157
165
  return absoluteId + (query ? `?${query}` : '');
158
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/vite-plugin",
3
- "version": "4.0.7",
3
+ "version": "4.0.8",
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": "^7.1.2"
18
+ "@vanilla-extract/integration": "^7.1.3"
19
19
  },
20
20
  "devDependencies": {
21
21
  "vite": "^5.0.11"