@vanilla-extract/vite-plugin 5.0.0-vite-plugin-filter-20250129023708 → 5.0.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.
@@ -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 }; }
|
@@ -37,7 +38,7 @@ function vanillaExtractPlugin({
|
|
37
38
|
let configEnv;
|
38
39
|
let server;
|
39
40
|
let packageName;
|
40
|
-
let compiler;
|
41
|
+
let compiler$1;
|
41
42
|
const vitePromise = import('vite');
|
42
43
|
const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
|
43
44
|
const getAbsoluteId = filePath => {
|
@@ -87,7 +88,7 @@ function vanillaExtractPlugin({
|
|
87
88
|
},
|
88
89
|
async buildStart() {
|
89
90
|
// Ensure we re-use the compiler instance between builds, e.g. in watch mode
|
90
|
-
if (mode !== 'transform' && !compiler) {
|
91
|
+
if (mode !== 'transform' && !compiler$1) {
|
91
92
|
var _configForViteCompile;
|
92
93
|
const {
|
93
94
|
loadConfigFromFile
|
@@ -114,7 +115,7 @@ function vanillaExtractPlugin({
|
|
114
115
|
pluginFilter
|
115
116
|
}))
|
116
117
|
};
|
117
|
-
compiler =
|
118
|
+
compiler$1 = compiler.createCompiler({
|
118
119
|
root: config.root,
|
119
120
|
identifiers: getIdentOption(),
|
120
121
|
cssImportSpecifier: fileIdToVirtualId,
|
@@ -127,12 +128,12 @@ function vanillaExtractPlugin({
|
|
127
128
|
// Instead, we close it when the watcher is closed via the closeWatcher hook.
|
128
129
|
if (!config.build.watch) {
|
129
130
|
var _compiler;
|
130
|
-
(_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
|
131
|
+
(_compiler = compiler$1) === null || _compiler === void 0 || _compiler.close();
|
131
132
|
}
|
132
133
|
},
|
133
134
|
closeWatcher() {
|
134
135
|
var _compiler2;
|
135
|
-
return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
|
136
|
+
return (_compiler2 = compiler$1) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
|
136
137
|
},
|
137
138
|
async transform(code, id) {
|
138
139
|
const [validId] = id.split('?');
|
@@ -149,12 +150,12 @@ function vanillaExtractPlugin({
|
|
149
150
|
identOption
|
150
151
|
});
|
151
152
|
}
|
152
|
-
if (compiler) {
|
153
|
+
if (compiler$1) {
|
153
154
|
const absoluteId = getAbsoluteId(validId);
|
154
155
|
const {
|
155
156
|
source,
|
156
157
|
watchFiles
|
157
|
-
} = await compiler.processVanillaFile(absoluteId, {
|
158
|
+
} = await compiler$1.processVanillaFile(absoluteId, {
|
158
159
|
outputCss: true
|
159
160
|
});
|
160
161
|
const result = {
|
@@ -191,18 +192,18 @@ function vanillaExtractPlugin({
|
|
191
192
|
if ( // We should always have CSS for a file here.
|
192
193
|
// The only valid scenario for a missing one is if someone had written
|
193
194
|
// a file in their app using the .vanilla.js/.vanilla.css extension
|
194
|
-
(_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
|
195
|
+
(_compiler3 = compiler$1) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
|
195
196
|
// Keep the original query string for HMR.
|
196
197
|
return absoluteId + (query ? `?${query}` : '');
|
197
198
|
}
|
198
199
|
},
|
199
200
|
load(id) {
|
200
201
|
const [validId] = id.split('?');
|
201
|
-
if (!isVirtualId(validId) || !compiler) return;
|
202
|
+
if (!isVirtualId(validId) || !compiler$1) return;
|
202
203
|
const absoluteId = getAbsoluteId(validId);
|
203
204
|
const {
|
204
205
|
css
|
205
|
-
} = compiler.getCssForFile(virtualIdToFileId(absoluteId));
|
206
|
+
} = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
|
206
207
|
return css;
|
207
208
|
}
|
208
209
|
};
|
@@ -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 }; }
|
@@ -37,7 +38,7 @@ function vanillaExtractPlugin({
|
|
37
38
|
let configEnv;
|
38
39
|
let server;
|
39
40
|
let packageName;
|
40
|
-
let compiler;
|
41
|
+
let compiler$1;
|
41
42
|
const vitePromise = import('vite');
|
42
43
|
const getIdentOption = () => identifiers ?? (config.mode === 'production' ? 'short' : 'debug');
|
43
44
|
const getAbsoluteId = filePath => {
|
@@ -87,7 +88,7 @@ function vanillaExtractPlugin({
|
|
87
88
|
},
|
88
89
|
async buildStart() {
|
89
90
|
// Ensure we re-use the compiler instance between builds, e.g. in watch mode
|
90
|
-
if (mode !== 'transform' && !compiler) {
|
91
|
+
if (mode !== 'transform' && !compiler$1) {
|
91
92
|
var _configForViteCompile;
|
92
93
|
const {
|
93
94
|
loadConfigFromFile
|
@@ -114,7 +115,7 @@ function vanillaExtractPlugin({
|
|
114
115
|
pluginFilter
|
115
116
|
}))
|
116
117
|
};
|
117
|
-
compiler =
|
118
|
+
compiler$1 = compiler.createCompiler({
|
118
119
|
root: config.root,
|
119
120
|
identifiers: getIdentOption(),
|
120
121
|
cssImportSpecifier: fileIdToVirtualId,
|
@@ -127,12 +128,12 @@ function vanillaExtractPlugin({
|
|
127
128
|
// Instead, we close it when the watcher is closed via the closeWatcher hook.
|
128
129
|
if (!config.build.watch) {
|
129
130
|
var _compiler;
|
130
|
-
(_compiler = compiler) === null || _compiler === void 0 || _compiler.close();
|
131
|
+
(_compiler = compiler$1) === null || _compiler === void 0 || _compiler.close();
|
131
132
|
}
|
132
133
|
},
|
133
134
|
closeWatcher() {
|
134
135
|
var _compiler2;
|
135
|
-
return (_compiler2 = compiler) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
|
136
|
+
return (_compiler2 = compiler$1) === null || _compiler2 === void 0 ? void 0 : _compiler2.close();
|
136
137
|
},
|
137
138
|
async transform(code, id) {
|
138
139
|
const [validId] = id.split('?');
|
@@ -149,12 +150,12 @@ function vanillaExtractPlugin({
|
|
149
150
|
identOption
|
150
151
|
});
|
151
152
|
}
|
152
|
-
if (compiler) {
|
153
|
+
if (compiler$1) {
|
153
154
|
const absoluteId = getAbsoluteId(validId);
|
154
155
|
const {
|
155
156
|
source,
|
156
157
|
watchFiles
|
157
|
-
} = await compiler.processVanillaFile(absoluteId, {
|
158
|
+
} = await compiler$1.processVanillaFile(absoluteId, {
|
158
159
|
outputCss: true
|
159
160
|
});
|
160
161
|
const result = {
|
@@ -191,18 +192,18 @@ function vanillaExtractPlugin({
|
|
191
192
|
if ( // We should always have CSS for a file here.
|
192
193
|
// The only valid scenario for a missing one is if someone had written
|
193
194
|
// a file in their app using the .vanilla.js/.vanilla.css extension
|
194
|
-
(_compiler3 = compiler) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
|
195
|
+
(_compiler3 = compiler$1) !== null && _compiler3 !== void 0 && _compiler3.getCssForFile(virtualIdToFileId(absoluteId))) {
|
195
196
|
// Keep the original query string for HMR.
|
196
197
|
return absoluteId + (query ? `?${query}` : '');
|
197
198
|
}
|
198
199
|
},
|
199
200
|
load(id) {
|
200
201
|
const [validId] = id.split('?');
|
201
|
-
if (!isVirtualId(validId) || !compiler) return;
|
202
|
+
if (!isVirtualId(validId) || !compiler$1) return;
|
202
203
|
const absoluteId = getAbsoluteId(validId);
|
203
204
|
const {
|
204
205
|
css
|
205
|
-
} = compiler.getCssForFile(virtualIdToFileId(absoluteId));
|
206
|
+
} = compiler$1.getCssForFile(virtualIdToFileId(absoluteId));
|
206
207
|
return css;
|
207
208
|
}
|
208
209
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import path from 'path';
|
2
|
-
import {
|
2
|
+
import { createCompiler } from '@vanilla-extract/compiler';
|
3
|
+
import { getPackageInfo, cssFileFilter, transform, normalizePath } from '@vanilla-extract/integration';
|
3
4
|
|
4
5
|
const PLUGIN_NAME = 'vite-plugin-vanilla-extract';
|
5
6
|
const virtualExtCss = '.vanilla.css';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vanilla-extract/vite-plugin",
|
3
|
-
"version": "5.0.0
|
3
|
+
"version": "5.0.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",
|
@@ -16,12 +16,13 @@
|
|
16
16
|
"author": "SEEK",
|
17
17
|
"license": "MIT",
|
18
18
|
"dependencies": {
|
19
|
-
"@vanilla-extract/
|
19
|
+
"@vanilla-extract/compiler": "^0.1.1",
|
20
|
+
"@vanilla-extract/integration": "^8.0.0"
|
20
21
|
},
|
21
22
|
"devDependencies": {
|
22
|
-
"vite": "^5.0.
|
23
|
+
"vite": "^5.0.0 || ^6.0.0"
|
23
24
|
},
|
24
25
|
"peerDependencies": {
|
25
|
-
"vite": "^
|
26
|
+
"vite": "^5.0.0 || ^6.0.0"
|
26
27
|
}
|
27
28
|
}
|