@vanilla-extract/vite-plugin 4.0.20-inline-cssesc-20250128002748 → 4.0.20-split-out-compiler-20250129230749

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.
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var path = require('path');
6
+ var compiler = require('@vanilla-extract/compiler');
6
7
  var integration = require('@vanilla-extract/integration');
7
8
 
8
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -35,7 +36,7 @@ function vanillaExtractPlugin({
35
36
  let configEnv;
36
37
  let server;
37
38
  let packageName;
38
- let compiler;
39
+ let compiler$1;
39
40
  const vitePromise = import('vite');
40
41
  const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
41
42
  const getAbsoluteId = filePath => {
@@ -85,7 +86,7 @@ function vanillaExtractPlugin({
85
86
  },
86
87
  async buildStart() {
87
88
  // Ensure we re-use the compiler instance between builds, e.g. in watch mode
88
- if (mode !== 'transform' && !compiler) {
89
+ if (mode !== 'transform' && !compiler$1) {
89
90
  var _configForViteCompile;
90
91
  const {
91
92
  loadConfigFromFile
@@ -109,7 +110,7 @@ function vanillaExtractPlugin({
109
110
  ...configForViteCompiler,
110
111
  plugins: (_configForViteCompile = configForViteCompiler) === null || _configForViteCompile === void 0 || (_configForViteCompile = _configForViteCompile.plugins) === null || _configForViteCompile === void 0 ? void 0 : _configForViteCompile.flat().filter(removeIncompatiblePlugins)
111
112
  };
112
- compiler = integration.createCompiler({
113
+ compiler$1 = compiler.createCompiler({
113
114
  root: config.root,
114
115
  identifiers: getIdentOption(),
115
116
  cssImportSpecifier: fileIdToVirtualId,
@@ -122,12 +123,12 @@ function vanillaExtractPlugin({
122
123
  // Instead, we close it when the watcher is closed via the closeWatcher hook.
123
124
  if (!config.build.watch) {
124
125
  var _compiler;
125
- (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
126
+ (_compiler = compiler$1) === null || _compiler === void 0 || _compiler.close();
126
127
  }
127
128
  },
128
129
  closeWatcher() {
129
130
  var _compiler2;
130
- return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
131
+ return (_compiler2 = compiler$1) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
131
132
  },
132
133
  async transform(code, id) {
133
134
  const [validId] = id.split('?');
@@ -144,12 +145,12 @@ function vanillaExtractPlugin({
144
145
  identOption
145
146
  });
146
147
  }
147
- if (compiler) {
148
+ if (compiler$1) {
148
149
  const absoluteId = getAbsoluteId(validId);
149
150
  const {
150
151
  source,
151
152
  watchFiles
152
- } = await compiler.processVanillaFile(absoluteId, {
153
+ } = await compiler$1.processVanillaFile(absoluteId, {
153
154
  outputCss: true
154
155
  });
155
156
  const result = {
@@ -186,18 +187,18 @@ function vanillaExtractPlugin({
186
187
  if ( // We should always have CSS for a file here.
187
188
  // The only valid scenario for a missing one is if someone had written
188
189
  // a file in their app using the .vanilla.js/.vanilla.css extension
189
- (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
190
+ (_compiler3 = compiler$1) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
190
191
  // Keep the original query string for HMR.
191
192
  return absoluteId + (query ? `?${query}` : '');
192
193
  }
193
194
  },
194
195
  load(id) {
195
196
  const [validId] = id.split('?');
196
- if (!isVirtualId(validId) || !compiler) return;
197
+ if (!isVirtualId(validId) || !compiler$1) return;
197
198
  const absoluteId = getAbsoluteId(validId);
198
199
  const {
199
200
  css
200
- } = compiler.getCssForFile(virtualIdToFileId(absoluteId));
201
+ } = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
201
202
  return css;
202
203
  }
203
204
  };
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var path = require('path');
6
+ var compiler = require('@vanilla-extract/compiler');
6
7
  var integration = require('@vanilla-extract/integration');
7
8
 
8
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -35,7 +36,7 @@ function vanillaExtractPlugin({
35
36
  let configEnv;
36
37
  let server;
37
38
  let packageName;
38
- let compiler;
39
+ let compiler$1;
39
40
  const vitePromise = import('vite');
40
41
  const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
41
42
  const getAbsoluteId = filePath => {
@@ -85,7 +86,7 @@ function vanillaExtractPlugin({
85
86
  },
86
87
  async buildStart() {
87
88
  // Ensure we re-use the compiler instance between builds, e.g. in watch mode
88
- if (mode !== 'transform' && !compiler) {
89
+ if (mode !== 'transform' && !compiler$1) {
89
90
  var _configForViteCompile;
90
91
  const {
91
92
  loadConfigFromFile
@@ -109,7 +110,7 @@ function vanillaExtractPlugin({
109
110
  ...configForViteCompiler,
110
111
  plugins: (_configForViteCompile = configForViteCompiler) === null || _configForViteCompile === void 0 || (_configForViteCompile = _configForViteCompile.plugins) === null || _configForViteCompile === void 0 ? void 0 : _configForViteCompile.flat().filter(removeIncompatiblePlugins)
111
112
  };
112
- compiler = integration.createCompiler({
113
+ compiler$1 = compiler.createCompiler({
113
114
  root: config.root,
114
115
  identifiers: getIdentOption(),
115
116
  cssImportSpecifier: fileIdToVirtualId,
@@ -122,12 +123,12 @@ function vanillaExtractPlugin({
122
123
  // Instead, we close it when the watcher is closed via the closeWatcher hook.
123
124
  if (!config.build.watch) {
124
125
  var _compiler;
125
- (_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
126
+ (_compiler = compiler$1) === null || _compiler === void 0 || _compiler.close();
126
127
  }
127
128
  },
128
129
  closeWatcher() {
129
130
  var _compiler2;
130
- return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
131
+ return (_compiler2 = compiler$1) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
131
132
  },
132
133
  async transform(code, id) {
133
134
  const [validId] = id.split('?');
@@ -144,12 +145,12 @@ function vanillaExtractPlugin({
144
145
  identOption
145
146
  });
146
147
  }
147
- if (compiler) {
148
+ if (compiler$1) {
148
149
  const absoluteId = getAbsoluteId(validId);
149
150
  const {
150
151
  source,
151
152
  watchFiles
152
- } = await compiler.processVanillaFile(absoluteId, {
153
+ } = await compiler$1.processVanillaFile(absoluteId, {
153
154
  outputCss: true
154
155
  });
155
156
  const result = {
@@ -186,18 +187,18 @@ function vanillaExtractPlugin({
186
187
  if ( // We should always have CSS for a file here.
187
188
  // The only valid scenario for a missing one is if someone had written
188
189
  // a file in their app using the .vanilla.js/.vanilla.css extension
189
- (_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
190
+ (_compiler3 = compiler$1) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
190
191
  // Keep the original query string for HMR.
191
192
  return absoluteId + (query ? `?${query}` : '');
192
193
  }
193
194
  },
194
195
  load(id) {
195
196
  const [validId] = id.split('?');
196
- if (!isVirtualId(validId) || !compiler) return;
197
+ if (!isVirtualId(validId) || !compiler$1) return;
197
198
  const absoluteId = getAbsoluteId(validId);
198
199
  const {
199
200
  css
200
- } = compiler.getCssForFile(virtualIdToFileId(absoluteId));
201
+ } = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
201
202
  return css;
202
203
  }
203
204
  };
@@ -1,5 +1,6 @@
1
1
  import path from 'path';
2
- import { getPackageInfo, createCompiler, cssFileFilter, transform, normalizePath } from '@vanilla-extract/integration';
2
+ import { createCompiler } from '@vanilla-extract/compiler';
3
+ import { getPackageInfo, cssFileFilter, transform, normalizePath } from '@vanilla-extract/integration';
3
4
 
4
5
  const virtualExtCss = '.vanilla.css';
5
6
  const isVirtualId = id => id.endsWith(virtualExtCss);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/vite-plugin",
3
- "version": "4.0.20-inline-cssesc-20250128002748",
3
+ "version": "4.0.20-split-out-compiler-20250129230749",
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,7 +16,8 @@
16
16
  "author": "SEEK",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@vanilla-extract/integration": "^7.1.13-inline-cssesc-20250128002748"
19
+ "@vanilla-extract/compiler": "^0.1.0-split-out-compiler-20250129230749",
20
+ "@vanilla-extract/integration": "^8.0.0-split-out-compiler-20250129230749"
20
21
  },
21
22
  "devDependencies": {
22
23
  "vite": "^5.0.11"