@vanilla-extract/vite-plugin 0.0.0-inline-prototype-2023326232811 → 0.0.0-proxy-pr-1252-20240125041511
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vanilla-extract-vite-plugin.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -3,30 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var path = require('path');
|
|
6
|
-
var vite = require('vite');
|
|
7
6
|
var outdent = require('outdent');
|
|
8
7
|
var integration = require('@vanilla-extract/integration');
|
|
9
8
|
|
|
10
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
11
10
|
|
|
12
|
-
function _interopNamespace(e) {
|
|
13
|
-
if (e && e.__esModule) return e;
|
|
14
|
-
var n = Object.create(null);
|
|
15
|
-
if (e) {
|
|
16
|
-
Object.keys(e).forEach(function (k) {
|
|
17
|
-
if (k !== 'default') {
|
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return e[k]; }
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
n["default"] = e;
|
|
27
|
-
return Object.freeze(n);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
11
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
31
12
|
var outdent__default = /*#__PURE__*/_interopDefault(outdent);
|
|
32
13
|
|
|
@@ -49,10 +30,9 @@ const resolvePostcssConfig = async config => {
|
|
|
49
30
|
} else {
|
|
50
31
|
try {
|
|
51
32
|
const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
|
|
52
|
-
const postCssConfig = await (await
|
|
33
|
+
const postCssConfig = await (await import('postcss-load-config')).default({}, searchPath);
|
|
53
34
|
return {
|
|
54
35
|
options: postCssConfig.options,
|
|
55
|
-
// @ts-expect-error - The postcssrc options don't agree with real postcss, but it should be ok
|
|
56
36
|
plugins: postCssConfig.plugins
|
|
57
37
|
};
|
|
58
38
|
} catch (e) {
|
|
@@ -75,11 +55,13 @@ function vanillaExtractPlugin({
|
|
|
75
55
|
let config;
|
|
76
56
|
let server;
|
|
77
57
|
let postCssConfig;
|
|
58
|
+
// We lazily load this utility from Vite
|
|
59
|
+
let normalizePath;
|
|
78
60
|
const cssMap = new Map();
|
|
79
61
|
const hasEmitCssOverride = typeof emitCssInSsr === 'boolean';
|
|
80
62
|
let resolvedEmitCssInSsr = hasEmitCssOverride ? emitCssInSsr : !!process.env.VITE_RSC_BUILD;
|
|
81
63
|
let packageName;
|
|
82
|
-
const getAbsoluteVirtualFileId = source =>
|
|
64
|
+
const getAbsoluteVirtualFileId = source => normalizePath(path__default["default"].join(config.root, source));
|
|
83
65
|
return {
|
|
84
66
|
name: 'vanilla-extract',
|
|
85
67
|
enforce: 'pre',
|
|
@@ -100,10 +82,11 @@ function vanillaExtractPlugin({
|
|
|
100
82
|
async configResolved(resolvedConfig) {
|
|
101
83
|
config = resolvedConfig;
|
|
102
84
|
packageName = integration.getPackageInfo(config.root).name;
|
|
85
|
+
normalizePath = (await import('vite')).normalizePath;
|
|
103
86
|
if (config.command === 'serve') {
|
|
104
87
|
postCssConfig = await resolvePostcssConfig(config);
|
|
105
88
|
}
|
|
106
|
-
if (!hasEmitCssOverride && config.plugins.some(plugin => ['astro:build', 'solid-start-server', 'vite-plugin-qwik', 'vite-plugin-svelte'].includes(plugin.name))) {
|
|
89
|
+
if (!hasEmitCssOverride && config.plugins.some(plugin => ['astro:build', 'remix', 'solid-start-server', 'vite-plugin-qwik', 'vite-plugin-svelte'].includes(plugin.name))) {
|
|
107
90
|
resolvedEmitCssInSsr = true;
|
|
108
91
|
}
|
|
109
92
|
},
|
|
@@ -171,7 +154,7 @@ function vanillaExtractPlugin({
|
|
|
171
154
|
if (ssr && !resolvedEmitCssInSsr) {
|
|
172
155
|
return integration.transform({
|
|
173
156
|
source: code,
|
|
174
|
-
filePath:
|
|
157
|
+
filePath: normalizePath(validId),
|
|
175
158
|
rootPath: config.root,
|
|
176
159
|
packageName,
|
|
177
160
|
identOption
|
|
@@ -189,7 +172,7 @@ function vanillaExtractPlugin({
|
|
|
189
172
|
for (const file of watchFiles) {
|
|
190
173
|
// In start mode, we need to prevent the file from rewatching itself.
|
|
191
174
|
// If it's a `build --watch`, it needs to watch everything.
|
|
192
|
-
if (config.command === 'build' || file !== validId) {
|
|
175
|
+
if (config.command === 'build' || normalizePath(file) !== validId) {
|
|
193
176
|
this.addWatchFile(file);
|
|
194
177
|
}
|
|
195
178
|
}
|
|
@@ -205,14 +188,14 @@ function vanillaExtractPlugin({
|
|
|
205
188
|
const absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
|
|
206
189
|
let cssSource = source;
|
|
207
190
|
if (postCssConfig) {
|
|
208
|
-
const postCssResult = await (await
|
|
191
|
+
const postCssResult = await (await import('postcss')).default(postCssConfig.plugins).process(source, {
|
|
209
192
|
...postCssConfig.options,
|
|
210
193
|
from: undefined,
|
|
211
194
|
map: false
|
|
212
195
|
});
|
|
213
196
|
cssSource = postCssResult.css;
|
|
214
197
|
}
|
|
215
|
-
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !==
|
|
198
|
+
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !== cssSource) {
|
|
216
199
|
const {
|
|
217
200
|
moduleGraph
|
|
218
201
|
} = server;
|
|
@@ -3,30 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var path = require('path');
|
|
6
|
-
var vite = require('vite');
|
|
7
6
|
var outdent = require('outdent');
|
|
8
7
|
var integration = require('@vanilla-extract/integration');
|
|
9
8
|
|
|
10
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
11
10
|
|
|
12
|
-
function _interopNamespace(e) {
|
|
13
|
-
if (e && e.__esModule) return e;
|
|
14
|
-
var n = Object.create(null);
|
|
15
|
-
if (e) {
|
|
16
|
-
Object.keys(e).forEach(function (k) {
|
|
17
|
-
if (k !== 'default') {
|
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return e[k]; }
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
n["default"] = e;
|
|
27
|
-
return Object.freeze(n);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
11
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
31
12
|
var outdent__default = /*#__PURE__*/_interopDefault(outdent);
|
|
32
13
|
|
|
@@ -49,10 +30,9 @@ const resolvePostcssConfig = async config => {
|
|
|
49
30
|
} else {
|
|
50
31
|
try {
|
|
51
32
|
const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
|
|
52
|
-
const postCssConfig = await (await
|
|
33
|
+
const postCssConfig = await (await import('postcss-load-config')).default({}, searchPath);
|
|
53
34
|
return {
|
|
54
35
|
options: postCssConfig.options,
|
|
55
|
-
// @ts-expect-error - The postcssrc options don't agree with real postcss, but it should be ok
|
|
56
36
|
plugins: postCssConfig.plugins
|
|
57
37
|
};
|
|
58
38
|
} catch (e) {
|
|
@@ -75,11 +55,13 @@ function vanillaExtractPlugin({
|
|
|
75
55
|
let config;
|
|
76
56
|
let server;
|
|
77
57
|
let postCssConfig;
|
|
58
|
+
// We lazily load this utility from Vite
|
|
59
|
+
let normalizePath;
|
|
78
60
|
const cssMap = new Map();
|
|
79
61
|
const hasEmitCssOverride = typeof emitCssInSsr === 'boolean';
|
|
80
62
|
let resolvedEmitCssInSsr = hasEmitCssOverride ? emitCssInSsr : !!process.env.VITE_RSC_BUILD;
|
|
81
63
|
let packageName;
|
|
82
|
-
const getAbsoluteVirtualFileId = source =>
|
|
64
|
+
const getAbsoluteVirtualFileId = source => normalizePath(path__default["default"].join(config.root, source));
|
|
83
65
|
return {
|
|
84
66
|
name: 'vanilla-extract',
|
|
85
67
|
enforce: 'pre',
|
|
@@ -100,10 +82,11 @@ function vanillaExtractPlugin({
|
|
|
100
82
|
async configResolved(resolvedConfig) {
|
|
101
83
|
config = resolvedConfig;
|
|
102
84
|
packageName = integration.getPackageInfo(config.root).name;
|
|
85
|
+
normalizePath = (await import('vite')).normalizePath;
|
|
103
86
|
if (config.command === 'serve') {
|
|
104
87
|
postCssConfig = await resolvePostcssConfig(config);
|
|
105
88
|
}
|
|
106
|
-
if (!hasEmitCssOverride && config.plugins.some(plugin => ['astro:build', 'solid-start-server', 'vite-plugin-qwik', 'vite-plugin-svelte'].includes(plugin.name))) {
|
|
89
|
+
if (!hasEmitCssOverride && config.plugins.some(plugin => ['astro:build', 'remix', 'solid-start-server', 'vite-plugin-qwik', 'vite-plugin-svelte'].includes(plugin.name))) {
|
|
107
90
|
resolvedEmitCssInSsr = true;
|
|
108
91
|
}
|
|
109
92
|
},
|
|
@@ -171,7 +154,7 @@ function vanillaExtractPlugin({
|
|
|
171
154
|
if (ssr && !resolvedEmitCssInSsr) {
|
|
172
155
|
return integration.transform({
|
|
173
156
|
source: code,
|
|
174
|
-
filePath:
|
|
157
|
+
filePath: normalizePath(validId),
|
|
175
158
|
rootPath: config.root,
|
|
176
159
|
packageName,
|
|
177
160
|
identOption
|
|
@@ -189,7 +172,7 @@ function vanillaExtractPlugin({
|
|
|
189
172
|
for (const file of watchFiles) {
|
|
190
173
|
// In start mode, we need to prevent the file from rewatching itself.
|
|
191
174
|
// If it's a `build --watch`, it needs to watch everything.
|
|
192
|
-
if (config.command === 'build' || file !== validId) {
|
|
175
|
+
if (config.command === 'build' || normalizePath(file) !== validId) {
|
|
193
176
|
this.addWatchFile(file);
|
|
194
177
|
}
|
|
195
178
|
}
|
|
@@ -205,14 +188,14 @@ function vanillaExtractPlugin({
|
|
|
205
188
|
const absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
|
|
206
189
|
let cssSource = source;
|
|
207
190
|
if (postCssConfig) {
|
|
208
|
-
const postCssResult = await (await
|
|
191
|
+
const postCssResult = await (await import('postcss')).default(postCssConfig.plugins).process(source, {
|
|
209
192
|
...postCssConfig.options,
|
|
210
193
|
from: undefined,
|
|
211
194
|
map: false
|
|
212
195
|
});
|
|
213
196
|
cssSource = postCssResult.css;
|
|
214
197
|
}
|
|
215
|
-
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !==
|
|
198
|
+
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !== cssSource) {
|
|
216
199
|
const {
|
|
217
200
|
moduleGraph
|
|
218
201
|
} = server;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { normalizePath } from 'vite';
|
|
3
2
|
import outdent from 'outdent';
|
|
4
3
|
import { getPackageInfo, cssFileFilter, transform, compile, processVanillaFile } from '@vanilla-extract/integration';
|
|
5
4
|
|
|
@@ -25,7 +24,6 @@ const resolvePostcssConfig = async config => {
|
|
|
25
24
|
const postCssConfig = await (await import('postcss-load-config')).default({}, searchPath);
|
|
26
25
|
return {
|
|
27
26
|
options: postCssConfig.options,
|
|
28
|
-
// @ts-expect-error - The postcssrc options don't agree with real postcss, but it should be ok
|
|
29
27
|
plugins: postCssConfig.plugins
|
|
30
28
|
};
|
|
31
29
|
} catch (e) {
|
|
@@ -48,6 +46,8 @@ function vanillaExtractPlugin({
|
|
|
48
46
|
let config;
|
|
49
47
|
let server;
|
|
50
48
|
let postCssConfig;
|
|
49
|
+
// We lazily load this utility from Vite
|
|
50
|
+
let normalizePath;
|
|
51
51
|
const cssMap = new Map();
|
|
52
52
|
const hasEmitCssOverride = typeof emitCssInSsr === 'boolean';
|
|
53
53
|
let resolvedEmitCssInSsr = hasEmitCssOverride ? emitCssInSsr : !!process.env.VITE_RSC_BUILD;
|
|
@@ -73,10 +73,11 @@ function vanillaExtractPlugin({
|
|
|
73
73
|
async configResolved(resolvedConfig) {
|
|
74
74
|
config = resolvedConfig;
|
|
75
75
|
packageName = getPackageInfo(config.root).name;
|
|
76
|
+
normalizePath = (await import('vite')).normalizePath;
|
|
76
77
|
if (config.command === 'serve') {
|
|
77
78
|
postCssConfig = await resolvePostcssConfig(config);
|
|
78
79
|
}
|
|
79
|
-
if (!hasEmitCssOverride && config.plugins.some(plugin => ['astro:build', 'solid-start-server', 'vite-plugin-qwik', 'vite-plugin-svelte'].includes(plugin.name))) {
|
|
80
|
+
if (!hasEmitCssOverride && config.plugins.some(plugin => ['astro:build', 'remix', 'solid-start-server', 'vite-plugin-qwik', 'vite-plugin-svelte'].includes(plugin.name))) {
|
|
80
81
|
resolvedEmitCssInSsr = true;
|
|
81
82
|
}
|
|
82
83
|
},
|
|
@@ -162,7 +163,7 @@ function vanillaExtractPlugin({
|
|
|
162
163
|
for (const file of watchFiles) {
|
|
163
164
|
// In start mode, we need to prevent the file from rewatching itself.
|
|
164
165
|
// If it's a `build --watch`, it needs to watch everything.
|
|
165
|
-
if (config.command === 'build' || file !== validId) {
|
|
166
|
+
if (config.command === 'build' || normalizePath(file) !== validId) {
|
|
166
167
|
this.addWatchFile(file);
|
|
167
168
|
}
|
|
168
169
|
}
|
|
@@ -185,7 +186,7 @@ function vanillaExtractPlugin({
|
|
|
185
186
|
});
|
|
186
187
|
cssSource = postCssResult.css;
|
|
187
188
|
}
|
|
188
|
-
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !==
|
|
189
|
+
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !== cssSource) {
|
|
189
190
|
const {
|
|
190
191
|
moduleGraph
|
|
191
192
|
} = server;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanilla-extract/vite-plugin",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-proxy-pr-1252-20240125041511",
|
|
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,15 +15,15 @@
|
|
|
15
15
|
"author": "SEEK",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@vanilla-extract/integration": "
|
|
18
|
+
"@vanilla-extract/integration": "0.0.0-proxy-pr-1252-20240125041511",
|
|
19
19
|
"outdent": "^0.8.0",
|
|
20
20
|
"postcss": "^8.3.6",
|
|
21
|
-
"postcss-load-config": "^
|
|
21
|
+
"postcss-load-config": "^4.0.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"vite": "npm:vite@^2.7.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"vite": "^2.2.3 || ^3.0.0 || ^4.0.3"
|
|
27
|
+
"vite": "^2.2.3 || ^3.0.0 || ^4.0.3 || ^5.0.0"
|
|
28
28
|
}
|
|
29
29
|
}
|