@vanilla-extract/vite-plugin 4.0.6 → 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.
@@ -105,14 +105,25 @@ function vanillaExtractPlugin({
105
105
  // If it _is_ loaded with a config file, it will create an infinite loop because it
106
106
  // also has a child compiler which uses the same mechanism to load the config file.
107
107
  // https://github.com/remix-run/remix/pull/7990#issuecomment-1809356626
108
- plugin.name !== 'remix')
108
+ // Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
109
+ // the main Remix plugin, and may not function correctly without it. To address this, we
110
+ // filter out all Remix-related plugins.
111
+ !plugin.name.startsWith('remix'))
109
112
  }
110
113
  });
111
114
  }
112
115
  },
113
116
  buildEnd() {
114
- var _compiler;
115
- (_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();
116
127
  },
117
128
  async transform(code, id) {
118
129
  const [validId] = id.split('?');
@@ -150,14 +161,14 @@ function vanillaExtractPlugin({
150
161
  }
151
162
  },
152
163
  resolveId(source) {
153
- var _compiler2;
164
+ var _compiler3;
154
165
  const [validId, query] = source.split('?');
155
166
  if (!isVirtualId(validId)) return;
156
167
  const absoluteId = getAbsoluteId(validId);
157
168
  if ( // We should always have CSS for a file here.
158
169
  // The only valid scenario for a missing one is if someone had written
159
170
  // a file in their app using the .vanilla.js/.vanilla.css extension
160
- (_compiler2 = compiler) !== null && _compiler2 !== void 0 && _compiler2.getCssForFile(virtualIdToFileId(absoluteId))) {
171
+ (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
161
172
  // Keep the original query string for HMR.
162
173
  return absoluteId + (query ? `?${query}` : '');
163
174
  }
@@ -105,14 +105,25 @@ function vanillaExtractPlugin({
105
105
  // If it _is_ loaded with a config file, it will create an infinite loop because it
106
106
  // also has a child compiler which uses the same mechanism to load the config file.
107
107
  // https://github.com/remix-run/remix/pull/7990#issuecomment-1809356626
108
- plugin.name !== 'remix')
108
+ // Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
109
+ // the main Remix plugin, and may not function correctly without it. To address this, we
110
+ // filter out all Remix-related plugins.
111
+ !plugin.name.startsWith('remix'))
109
112
  }
110
113
  });
111
114
  }
112
115
  },
113
116
  buildEnd() {
114
- var _compiler;
115
- (_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();
116
127
  },
117
128
  async transform(code, id) {
118
129
  const [validId] = id.split('?');
@@ -150,14 +161,14 @@ function vanillaExtractPlugin({
150
161
  }
151
162
  },
152
163
  resolveId(source) {
153
- var _compiler2;
164
+ var _compiler3;
154
165
  const [validId, query] = source.split('?');
155
166
  if (!isVirtualId(validId)) return;
156
167
  const absoluteId = getAbsoluteId(validId);
157
168
  if ( // We should always have CSS for a file here.
158
169
  // The only valid scenario for a missing one is if someone had written
159
170
  // a file in their app using the .vanilla.js/.vanilla.css extension
160
- (_compiler2 = compiler) !== null && _compiler2 !== void 0 && _compiler2.getCssForFile(virtualIdToFileId(absoluteId))) {
171
+ (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
161
172
  // Keep the original query string for HMR.
162
173
  return absoluteId + (query ? `?${query}` : '');
163
174
  }
@@ -97,14 +97,25 @@ function vanillaExtractPlugin({
97
97
  // If it _is_ loaded with a config file, it will create an infinite loop because it
98
98
  // also has a child compiler which uses the same mechanism to load the config file.
99
99
  // https://github.com/remix-run/remix/pull/7990#issuecomment-1809356626
100
- plugin.name !== 'remix')
100
+ // Additionally, some internal Remix plugins rely on a `ctx` object to be initialized by
101
+ // the main Remix plugin, and may not function correctly without it. To address this, we
102
+ // filter out all Remix-related plugins.
103
+ !plugin.name.startsWith('remix'))
101
104
  }
102
105
  });
103
106
  }
104
107
  },
105
108
  buildEnd() {
106
- var _compiler;
107
- (_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();
108
119
  },
109
120
  async transform(code, id) {
110
121
  const [validId] = id.split('?');
@@ -142,14 +153,14 @@ function vanillaExtractPlugin({
142
153
  }
143
154
  },
144
155
  resolveId(source) {
145
- var _compiler2;
156
+ var _compiler3;
146
157
  const [validId, query] = source.split('?');
147
158
  if (!isVirtualId(validId)) return;
148
159
  const absoluteId = getAbsoluteId(validId);
149
160
  if ( // We should always have CSS for a file here.
150
161
  // The only valid scenario for a missing one is if someone had written
151
162
  // a file in their app using the .vanilla.js/.vanilla.css extension
152
- (_compiler2 = compiler) !== null && _compiler2 !== void 0 && _compiler2.getCssForFile(virtualIdToFileId(absoluteId))) {
163
+ (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
153
164
  // Keep the original query string for HMR.
154
165
  return absoluteId + (query ? `?${query}` : '');
155
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/vite-plugin",
3
- "version": "4.0.6",
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.0"
18
+ "@vanilla-extract/integration": "^7.1.3"
19
19
  },
20
20
  "devDependencies": {
21
21
  "vite": "^5.0.11"