@vanilla-extract/vite-plugin 3.1.7 → 3.2.0
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.
package/README.md
CHANGED
|
@@ -88,6 +88,7 @@ Want to work at a higher level while maximising style re-use? Check out 🍨 [S
|
|
|
88
88
|
- [Test environments](#test-environments)
|
|
89
89
|
- [Configuration](#configuration)
|
|
90
90
|
- [identifiers](#identifiers)
|
|
91
|
+
- [esbuildOptions](#esbuildoptions)
|
|
91
92
|
- [Styling API](#styling-api)
|
|
92
93
|
- [style](#style)
|
|
93
94
|
- [styleVariants](#stylevariants)
|
|
@@ -393,6 +394,12 @@ Different formatting of identifiers (e.g. class names, keyframes, CSS Vars, etc)
|
|
|
393
394
|
|
|
394
395
|
Each integration will set a default value based on the configuration options passed to the bundler.
|
|
395
396
|
|
|
397
|
+
### esbuildOptions
|
|
398
|
+
> Only for `esbuild`, `vite` and `rollup` plugins
|
|
399
|
+
|
|
400
|
+
esbuild is used internally to compile `.css.ts` files before evaluating them to extract styles. You can pass additional options here to customize that process.
|
|
401
|
+
Accepts a subset of esbuild build options (`plugins`, `external`, `define` and `loader`), see https://esbuild.github.io/api/#build-api.
|
|
402
|
+
|
|
396
403
|
---
|
|
397
404
|
|
|
398
405
|
## Styling API
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
import { IdentifierOption } from '@vanilla-extract/integration';
|
|
2
|
+
import { IdentifierOption, CompileOptions } from '@vanilla-extract/integration';
|
|
3
3
|
interface Options {
|
|
4
4
|
identifiers?: IdentifierOption;
|
|
5
|
+
esbuildOptions?: CompileOptions['esbuildOptions'];
|
|
5
6
|
}
|
|
6
|
-
export declare function vanillaExtractPlugin({ identifiers }?: Options): Plugin;
|
|
7
|
+
export declare function vanillaExtractPlugin({ identifiers, esbuildOptions, }?: Options): Plugin;
|
|
7
8
|
export {};
|
|
@@ -69,7 +69,8 @@ const resolvePostcssConfig = async config => {
|
|
|
69
69
|
const styleUpdateEvent = fileId => `vanilla-extract-style-update:${fileId}`;
|
|
70
70
|
|
|
71
71
|
function vanillaExtractPlugin({
|
|
72
|
-
identifiers
|
|
72
|
+
identifiers,
|
|
73
|
+
esbuildOptions
|
|
73
74
|
} = {}) {
|
|
74
75
|
let config;
|
|
75
76
|
let server;
|
|
@@ -190,7 +191,8 @@ function vanillaExtractPlugin({
|
|
|
190
191
|
watchFiles
|
|
191
192
|
} = await integration.compile({
|
|
192
193
|
filePath: validId,
|
|
193
|
-
cwd: config.root
|
|
194
|
+
cwd: config.root,
|
|
195
|
+
esbuildOptions
|
|
194
196
|
});
|
|
195
197
|
|
|
196
198
|
for (const file of watchFiles) {
|
|
@@ -69,7 +69,8 @@ const resolvePostcssConfig = async config => {
|
|
|
69
69
|
const styleUpdateEvent = fileId => `vanilla-extract-style-update:${fileId}`;
|
|
70
70
|
|
|
71
71
|
function vanillaExtractPlugin({
|
|
72
|
-
identifiers
|
|
72
|
+
identifiers,
|
|
73
|
+
esbuildOptions
|
|
73
74
|
} = {}) {
|
|
74
75
|
let config;
|
|
75
76
|
let server;
|
|
@@ -190,7 +191,8 @@ function vanillaExtractPlugin({
|
|
|
190
191
|
watchFiles
|
|
191
192
|
} = await integration.compile({
|
|
192
193
|
filePath: validId,
|
|
193
|
-
cwd: config.root
|
|
194
|
+
cwd: config.root,
|
|
195
|
+
esbuildOptions
|
|
194
196
|
});
|
|
195
197
|
|
|
196
198
|
for (const file of watchFiles) {
|
|
@@ -42,7 +42,8 @@ const resolvePostcssConfig = async config => {
|
|
|
42
42
|
const styleUpdateEvent = fileId => `vanilla-extract-style-update:${fileId}`;
|
|
43
43
|
|
|
44
44
|
function vanillaExtractPlugin({
|
|
45
|
-
identifiers
|
|
45
|
+
identifiers,
|
|
46
|
+
esbuildOptions
|
|
46
47
|
} = {}) {
|
|
47
48
|
let config;
|
|
48
49
|
let server;
|
|
@@ -163,7 +164,8 @@ function vanillaExtractPlugin({
|
|
|
163
164
|
watchFiles
|
|
164
165
|
} = await compile({
|
|
165
166
|
filePath: validId,
|
|
166
|
-
cwd: config.root
|
|
167
|
+
cwd: config.root,
|
|
168
|
+
esbuildOptions
|
|
167
169
|
});
|
|
168
170
|
|
|
169
171
|
for (const file of watchFiles) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanilla-extract/vite-plugin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
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": "^
|
|
18
|
+
"@vanilla-extract/integration": "^5.0.0",
|
|
19
19
|
"outdent": "^0.8.0",
|
|
20
20
|
"postcss": "^8.3.6",
|
|
21
21
|
"postcss-load-config": "^3.1.0"
|