@vanilla-extract/vite-plugin 5.0.2-vite-compiler-no-base-20250508033042 → 5.0.3-compiler-use-parent-watcher-20250521111515

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.
@@ -15,6 +15,6 @@ interface Options {
15
15
  unstable_pluginFilter?: PluginFilter;
16
16
  unstable_mode?: 'transform' | 'emitCss';
17
17
  }
18
- declare function vanillaExtractPlugin({ identifiers, unstable_pluginFilter: pluginFilter, unstable_mode: mode, }?: Options): Plugin;
18
+ declare function vanillaExtractPlugin({ identifiers, unstable_pluginFilter: pluginFilter, unstable_mode, }?: Options): Plugin;
19
19
 
20
20
  export { vanillaExtractPlugin };
@@ -32,13 +32,14 @@ const withUserPluginFilter = ({
32
32
  function vanillaExtractPlugin({
33
33
  identifiers,
34
34
  unstable_pluginFilter: pluginFilter = defaultPluginFilter,
35
- unstable_mode: mode = 'emitCss'
35
+ unstable_mode = 'emitCss'
36
36
  } = {}) {
37
37
  let config;
38
38
  let configEnv;
39
39
  let server;
40
40
  let packageName;
41
41
  let compiler$1;
42
+ let isBuild;
42
43
  const vitePromise = import('vite');
43
44
  const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
44
45
  const getAbsoluteId = filePath => {
@@ -84,11 +85,12 @@ function vanillaExtractPlugin({
84
85
  },
85
86
  async configResolved(_resolvedConfig) {
86
87
  config = _resolvedConfig;
88
+ isBuild = config.command === 'build' && !config.build.watch;
87
89
  packageName = integration.getPackageInfo(config.root).name;
88
90
  },
89
91
  async buildStart() {
90
92
  // Ensure we re-use the compiler instance between builds, e.g. in watch mode
91
- if (mode !== 'transform' && !compiler$1) {
93
+ if (unstable_mode !== 'transform' && !compiler$1) {
92
94
  var _configForViteCompile;
93
95
  const {
94
96
  loadConfigFromFile
@@ -113,15 +115,14 @@ function vanillaExtractPlugin({
113
115
  plugins: (_configForViteCompile = configForViteCompiler) === null || _configForViteCompile === void 0 || (_configForViteCompile = _configForViteCompile.plugins) === null || _configForViteCompile === void 0 ? void 0 : _configForViteCompile.flat().filter(isPluginObject).filter(withUserPluginFilter({
114
116
  mode: config.mode,
115
117
  pluginFilter
116
- })),
117
- // Does this get reset to the default of '/', or does it do something ese?
118
- base: undefined
118
+ }))
119
119
  };
120
120
  compiler$1 = compiler.createCompiler({
121
121
  root: config.root,
122
122
  identifiers: getIdentOption(),
123
123
  cssImportSpecifier: fileIdToVirtualId,
124
- viteConfig
124
+ viteConfig,
125
+ enableFileWatcher: !isBuild
125
126
  });
126
127
  }
127
128
  },
@@ -143,7 +144,7 @@ function vanillaExtractPlugin({
143
144
  return null;
144
145
  }
145
146
  const identOption = getIdentOption();
146
- if (mode === 'transform') {
147
+ if (unstable_mode === 'transform') {
147
148
  return integration.transform({
148
149
  source: code,
149
150
  filePath: integration.normalizePath(validId),
@@ -168,7 +169,7 @@ function vanillaExtractPlugin({
168
169
  };
169
170
 
170
171
  // We don't need to watch files in build mode
171
- if (config.command === 'build' && !config.build.watch) {
172
+ if (isBuild) {
172
173
  return result;
173
174
  }
174
175
  for (const file of watchFiles) {
@@ -32,13 +32,14 @@ const withUserPluginFilter = ({
32
32
  function vanillaExtractPlugin({
33
33
  identifiers,
34
34
  unstable_pluginFilter: pluginFilter = defaultPluginFilter,
35
- unstable_mode: mode = 'emitCss'
35
+ unstable_mode = 'emitCss'
36
36
  } = {}) {
37
37
  let config;
38
38
  let configEnv;
39
39
  let server;
40
40
  let packageName;
41
41
  let compiler$1;
42
+ let isBuild;
42
43
  const vitePromise = import('vite');
43
44
  const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
44
45
  const getAbsoluteId = filePath => {
@@ -84,11 +85,12 @@ function vanillaExtractPlugin({
84
85
  },
85
86
  async configResolved(_resolvedConfig) {
86
87
  config = _resolvedConfig;
88
+ isBuild = config.command === 'build' && !config.build.watch;
87
89
  packageName = integration.getPackageInfo(config.root).name;
88
90
  },
89
91
  async buildStart() {
90
92
  // Ensure we re-use the compiler instance between builds, e.g. in watch mode
91
- if (mode !== 'transform' && !compiler$1) {
93
+ if (unstable_mode !== 'transform' && !compiler$1) {
92
94
  var _configForViteCompile;
93
95
  const {
94
96
  loadConfigFromFile
@@ -113,15 +115,14 @@ function vanillaExtractPlugin({
113
115
  plugins: (_configForViteCompile = configForViteCompiler) === null || _configForViteCompile === void 0 || (_configForViteCompile = _configForViteCompile.plugins) === null || _configForViteCompile === void 0 ? void 0 : _configForViteCompile.flat().filter(isPluginObject).filter(withUserPluginFilter({
114
116
  mode: config.mode,
115
117
  pluginFilter
116
- })),
117
- // Does this get reset to the default of '/', or does it do something ese?
118
- base: undefined
118
+ }))
119
119
  };
120
120
  compiler$1 = compiler.createCompiler({
121
121
  root: config.root,
122
122
  identifiers: getIdentOption(),
123
123
  cssImportSpecifier: fileIdToVirtualId,
124
- viteConfig
124
+ viteConfig,
125
+ enableFileWatcher: !isBuild
125
126
  });
126
127
  }
127
128
  },
@@ -143,7 +144,7 @@ function vanillaExtractPlugin({
143
144
  return null;
144
145
  }
145
146
  const identOption = getIdentOption();
146
- if (mode === 'transform') {
147
+ if (unstable_mode === 'transform') {
147
148
  return integration.transform({
148
149
  source: code,
149
150
  filePath: integration.normalizePath(validId),
@@ -168,7 +169,7 @@ function vanillaExtractPlugin({
168
169
  };
169
170
 
170
171
  // We don't need to watch files in build mode
171
- if (config.command === 'build' && !config.build.watch) {
172
+ if (isBuild) {
172
173
  return result;
173
174
  }
174
175
  for (const file of watchFiles) {
@@ -24,13 +24,14 @@ const withUserPluginFilter = ({
24
24
  function vanillaExtractPlugin({
25
25
  identifiers,
26
26
  unstable_pluginFilter: pluginFilter = defaultPluginFilter,
27
- unstable_mode: mode = 'emitCss'
27
+ unstable_mode = 'emitCss'
28
28
  } = {}) {
29
29
  let config;
30
30
  let configEnv;
31
31
  let server;
32
32
  let packageName;
33
33
  let compiler;
34
+ let isBuild;
34
35
  const vitePromise = import('vite');
35
36
  const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
36
37
  const getAbsoluteId = filePath => {
@@ -76,11 +77,12 @@ function vanillaExtractPlugin({
76
77
  },
77
78
  async configResolved(_resolvedConfig) {
78
79
  config = _resolvedConfig;
80
+ isBuild = config.command === 'build' && !config.build.watch;
79
81
  packageName = getPackageInfo(config.root).name;
80
82
  },
81
83
  async buildStart() {
82
84
  // Ensure we re-use the compiler instance between builds, e.g. in watch mode
83
- if (mode !== 'transform' && !compiler) {
85
+ if (unstable_mode !== 'transform' && !compiler) {
84
86
  var _configForViteCompile;
85
87
  const {
86
88
  loadConfigFromFile
@@ -105,15 +107,14 @@ function vanillaExtractPlugin({
105
107
  plugins: (_configForViteCompile = configForViteCompiler) === null || _configForViteCompile === void 0 || (_configForViteCompile = _configForViteCompile.plugins) === null || _configForViteCompile === void 0 ? void 0 : _configForViteCompile.flat().filter(isPluginObject).filter(withUserPluginFilter({
106
108
  mode: config.mode,
107
109
  pluginFilter
108
- })),
109
- // Does this get reset to the default of '/', or does it do something ese?
110
- base: undefined
110
+ }))
111
111
  };
112
112
  compiler = createCompiler({
113
113
  root: config.root,
114
114
  identifiers: getIdentOption(),
115
115
  cssImportSpecifier: fileIdToVirtualId,
116
- viteConfig
116
+ viteConfig,
117
+ enableFileWatcher: !isBuild
117
118
  });
118
119
  }
119
120
  },
@@ -135,7 +136,7 @@ function vanillaExtractPlugin({
135
136
  return null;
136
137
  }
137
138
  const identOption = getIdentOption();
138
- if (mode === 'transform') {
139
+ if (unstable_mode === 'transform') {
139
140
  return transform({
140
141
  source: code,
141
142
  filePath: normalizePath(validId),
@@ -160,7 +161,7 @@ function vanillaExtractPlugin({
160
161
  };
161
162
 
162
163
  // We don't need to watch files in build mode
163
- if (config.command === 'build' && !config.build.watch) {
164
+ if (isBuild) {
164
165
  return result;
165
166
  }
166
167
  for (const file of watchFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/vite-plugin",
3
- "version": "5.0.2-vite-compiler-no-base-20250508033042",
3
+ "version": "5.0.3-compiler-use-parent-watcher-20250521111515",
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,8 +16,8 @@
16
16
  "author": "SEEK",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@vanilla-extract/compiler": "^0.1.3-vite-compiler-no-base-20250508033042",
20
- "@vanilla-extract/integration": "^8.0.2-vite-compiler-no-base-20250508033042"
19
+ "@vanilla-extract/compiler": "^0.2.0-compiler-use-parent-watcher-20250521111515",
20
+ "@vanilla-extract/integration": "^8.0.2"
21
21
  },
22
22
  "devDependencies": {
23
23
  "vite": "^5.0.0 || ^6.0.0"