You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Flag whether to start with server at development time,
154
+
* because unplugin-vue-cssvars uses different strategies for building and server development
155
+
* @defaulttrue
156
+
*/
157
+
server?:boolean
154
158
}
155
159
```
156
-
### Details about revoke
157
-
> 💡 v1.0.0 version to solve the problem of duplicate code, no longer need to set
158
-
159
-
Suppose there are two files `App.vue` and `test.css`
160
-
````
161
-
<script setup lang="ts">
162
-
const color = 'red'
163
-
</script>
164
-
165
-
<template>
166
-
<div class="test">
167
-
TEST
168
-
</div>
169
-
</template>
170
-
171
-
<style scoped>
172
-
@import "./assets/test";
173
-
</style>
174
-
175
-
````
176
-
````
177
-
/** test.css **/
178
-
div {
179
-
color: v-bind(color);
180
-
}
181
-
````
182
-
After building with `vite` when `unplugin-vue-cssvars` is not used
183
-
````
184
-
/** test.css **/
185
-
div[data-v-2e7c9788] {
186
-
color: var(--8bcabd20);
187
-
}
188
-
````
189
-
Among them, the hash of `color: var(--8bcabd20);` will not appear in the component packaging product, because `vue` does not support the use of `v-bind` in the file.
190
-
When built with `vite` using `unplugin-vue-cssvars` (`minify: false`)
191
-
````
192
-
/** test.css **/
193
-
div[data-v-1dfefb04] {
194
-
color: var(--516b0d4a);
195
-
}
196
-
197
-
/* created by @unplugin-vue-cssvars */
198
-
/* <inject start> */
199
-
div[data-v-1dfefb04]{color:var(--516b0d4a)}
200
-
/* <inject end> */
201
-
````
202
-
It can be seen that the code will be injected through `unplugin-vue-cssvars`, and it depends on `@vue/compiler-dom`, whose hash value can appear in the component packaging product.
203
-
But observation found that this code is repetitive.
204
-
Therefore, turning on the `revoke` option will remove duplicate code
0 commit comments