@plumeria/unplugin 12.0.4 → 12.0.5
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/dist/core.js +33 -24
- package/dist/core.mjs +33 -24
- package/package.json +2 -2
package/dist/core.js
CHANGED
|
@@ -145,6 +145,10 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
145
145
|
const localConsts = (0, utils_1.collectLocalConsts)(ast);
|
|
146
146
|
const resourcePath = id;
|
|
147
147
|
const importMap = {};
|
|
148
|
+
const keyframesImportMap = {};
|
|
149
|
+
const viewTransitionImportMap = {};
|
|
150
|
+
const createImportMap = {};
|
|
151
|
+
const variantsImportMap = {};
|
|
148
152
|
const createThemeImportMap = {};
|
|
149
153
|
const createStaticImportMap = {};
|
|
150
154
|
const plumeriaAliases = {};
|
|
@@ -180,19 +184,19 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
180
184
|
importMap[localName] = scannedTables.staticTable[uniqueKey];
|
|
181
185
|
}
|
|
182
186
|
if (scannedTables.keyframesHashTable[uniqueKey]) {
|
|
183
|
-
|
|
187
|
+
keyframesImportMap[localName] =
|
|
184
188
|
scannedTables.keyframesHashTable[uniqueKey];
|
|
185
189
|
}
|
|
186
190
|
if (scannedTables.viewTransitionHashTable[uniqueKey]) {
|
|
187
|
-
|
|
191
|
+
viewTransitionImportMap[localName] =
|
|
188
192
|
scannedTables.viewTransitionHashTable[uniqueKey];
|
|
189
193
|
}
|
|
190
194
|
if (scannedTables.createHashTable[uniqueKey]) {
|
|
191
|
-
|
|
195
|
+
createImportMap[localName] =
|
|
192
196
|
scannedTables.createHashTable[uniqueKey];
|
|
193
197
|
}
|
|
194
198
|
if (scannedTables.variantsHashTable[uniqueKey]) {
|
|
195
|
-
|
|
199
|
+
variantsImportMap[localName] =
|
|
196
200
|
scannedTables.variantsHashTable[uniqueKey];
|
|
197
201
|
}
|
|
198
202
|
if (scannedTables.createThemeHashTable[uniqueKey]) {
|
|
@@ -221,44 +225,49 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
221
225
|
const mergedKeyframesTable = {};
|
|
222
226
|
for (const key of Object.keys(scannedTables.keyframesHashTable)) {
|
|
223
227
|
mergedKeyframesTable[key] = scannedTables.keyframesHashTable[key];
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if (typeof val === 'string') {
|
|
228
|
-
mergedKeyframesTable[key] = val;
|
|
228
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
229
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
230
|
+
mergedKeyframesTable[varName] = scannedTables.keyframesHashTable[key];
|
|
229
231
|
}
|
|
230
232
|
}
|
|
233
|
+
for (const key of Object.keys(keyframesImportMap)) {
|
|
234
|
+
mergedKeyframesTable[key] = keyframesImportMap[key];
|
|
235
|
+
}
|
|
231
236
|
const mergedViewTransitionTable = {};
|
|
232
237
|
for (const key of Object.keys(scannedTables.viewTransitionHashTable)) {
|
|
233
238
|
mergedViewTransitionTable[key] =
|
|
234
239
|
scannedTables.viewTransitionHashTable[key];
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
mergedViewTransitionTable[key] = val;
|
|
240
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
241
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
242
|
+
mergedViewTransitionTable[varName] =
|
|
243
|
+
scannedTables.viewTransitionHashTable[key];
|
|
240
244
|
}
|
|
241
245
|
}
|
|
246
|
+
for (const key of Object.keys(viewTransitionImportMap)) {
|
|
247
|
+
mergedViewTransitionTable[key] = viewTransitionImportMap[key];
|
|
248
|
+
}
|
|
242
249
|
const mergedCreateTable = {};
|
|
243
250
|
for (const key of Object.keys(scannedTables.createHashTable)) {
|
|
244
251
|
mergedCreateTable[key] = scannedTables.createHashTable[key];
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (typeof val === 'string') {
|
|
249
|
-
mergedCreateTable[key] = val;
|
|
252
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
253
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
254
|
+
mergedCreateTable[varName] = scannedTables.createHashTable[key];
|
|
250
255
|
}
|
|
251
256
|
}
|
|
257
|
+
for (const key of Object.keys(createImportMap)) {
|
|
258
|
+
mergedCreateTable[key] = createImportMap[key];
|
|
259
|
+
}
|
|
252
260
|
const mergedVariantsTable = {};
|
|
253
261
|
for (const key of Object.keys(scannedTables.variantsHashTable)) {
|
|
254
262
|
mergedVariantsTable[key] = scannedTables.variantsHashTable[key];
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (typeof val === 'string') {
|
|
259
|
-
mergedVariantsTable[key] = val;
|
|
263
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
264
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
265
|
+
mergedVariantsTable[varName] = scannedTables.variantsHashTable[key];
|
|
260
266
|
}
|
|
261
267
|
}
|
|
268
|
+
for (const key of Object.keys(variantsImportMap)) {
|
|
269
|
+
mergedVariantsTable[key] = variantsImportMap[key];
|
|
270
|
+
}
|
|
262
271
|
const mergedCreateThemeHashTable = {};
|
|
263
272
|
for (const key of Object.keys(scannedTables.createThemeHashTable)) {
|
|
264
273
|
mergedCreateThemeHashTable[key] =
|
package/dist/core.mjs
CHANGED
|
@@ -109,6 +109,10 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
109
109
|
const localConsts = collectLocalConsts(ast);
|
|
110
110
|
const resourcePath = id;
|
|
111
111
|
const importMap = {};
|
|
112
|
+
const keyframesImportMap = {};
|
|
113
|
+
const viewTransitionImportMap = {};
|
|
114
|
+
const createImportMap = {};
|
|
115
|
+
const variantsImportMap = {};
|
|
112
116
|
const createThemeImportMap = {};
|
|
113
117
|
const createStaticImportMap = {};
|
|
114
118
|
const plumeriaAliases = {};
|
|
@@ -144,19 +148,19 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
144
148
|
importMap[localName] = scannedTables.staticTable[uniqueKey];
|
|
145
149
|
}
|
|
146
150
|
if (scannedTables.keyframesHashTable[uniqueKey]) {
|
|
147
|
-
|
|
151
|
+
keyframesImportMap[localName] =
|
|
148
152
|
scannedTables.keyframesHashTable[uniqueKey];
|
|
149
153
|
}
|
|
150
154
|
if (scannedTables.viewTransitionHashTable[uniqueKey]) {
|
|
151
|
-
|
|
155
|
+
viewTransitionImportMap[localName] =
|
|
152
156
|
scannedTables.viewTransitionHashTable[uniqueKey];
|
|
153
157
|
}
|
|
154
158
|
if (scannedTables.createHashTable[uniqueKey]) {
|
|
155
|
-
|
|
159
|
+
createImportMap[localName] =
|
|
156
160
|
scannedTables.createHashTable[uniqueKey];
|
|
157
161
|
}
|
|
158
162
|
if (scannedTables.variantsHashTable[uniqueKey]) {
|
|
159
|
-
|
|
163
|
+
variantsImportMap[localName] =
|
|
160
164
|
scannedTables.variantsHashTable[uniqueKey];
|
|
161
165
|
}
|
|
162
166
|
if (scannedTables.createThemeHashTable[uniqueKey]) {
|
|
@@ -185,44 +189,49 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
|
|
|
185
189
|
const mergedKeyframesTable = {};
|
|
186
190
|
for (const key of Object.keys(scannedTables.keyframesHashTable)) {
|
|
187
191
|
mergedKeyframesTable[key] = scannedTables.keyframesHashTable[key];
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (typeof val === 'string') {
|
|
192
|
-
mergedKeyframesTable[key] = val;
|
|
192
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
193
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
194
|
+
mergedKeyframesTable[varName] = scannedTables.keyframesHashTable[key];
|
|
193
195
|
}
|
|
194
196
|
}
|
|
197
|
+
for (const key of Object.keys(keyframesImportMap)) {
|
|
198
|
+
mergedKeyframesTable[key] = keyframesImportMap[key];
|
|
199
|
+
}
|
|
195
200
|
const mergedViewTransitionTable = {};
|
|
196
201
|
for (const key of Object.keys(scannedTables.viewTransitionHashTable)) {
|
|
197
202
|
mergedViewTransitionTable[key] =
|
|
198
203
|
scannedTables.viewTransitionHashTable[key];
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
mergedViewTransitionTable[key] = val;
|
|
204
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
205
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
206
|
+
mergedViewTransitionTable[varName] =
|
|
207
|
+
scannedTables.viewTransitionHashTable[key];
|
|
204
208
|
}
|
|
205
209
|
}
|
|
210
|
+
for (const key of Object.keys(viewTransitionImportMap)) {
|
|
211
|
+
mergedViewTransitionTable[key] = viewTransitionImportMap[key];
|
|
212
|
+
}
|
|
206
213
|
const mergedCreateTable = {};
|
|
207
214
|
for (const key of Object.keys(scannedTables.createHashTable)) {
|
|
208
215
|
mergedCreateTable[key] = scannedTables.createHashTable[key];
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (typeof val === 'string') {
|
|
213
|
-
mergedCreateTable[key] = val;
|
|
216
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
217
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
218
|
+
mergedCreateTable[varName] = scannedTables.createHashTable[key];
|
|
214
219
|
}
|
|
215
220
|
}
|
|
221
|
+
for (const key of Object.keys(createImportMap)) {
|
|
222
|
+
mergedCreateTable[key] = createImportMap[key];
|
|
223
|
+
}
|
|
216
224
|
const mergedVariantsTable = {};
|
|
217
225
|
for (const key of Object.keys(scannedTables.variantsHashTable)) {
|
|
218
226
|
mergedVariantsTable[key] = scannedTables.variantsHashTable[key];
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (typeof val === 'string') {
|
|
223
|
-
mergedVariantsTable[key] = val;
|
|
227
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
228
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
229
|
+
mergedVariantsTable[varName] = scannedTables.variantsHashTable[key];
|
|
224
230
|
}
|
|
225
231
|
}
|
|
232
|
+
for (const key of Object.keys(variantsImportMap)) {
|
|
233
|
+
mergedVariantsTable[key] = variantsImportMap[key];
|
|
234
|
+
}
|
|
226
235
|
const mergedCreateThemeHashTable = {};
|
|
227
236
|
for (const key of Object.keys(scannedTables.createThemeHashTable)) {
|
|
228
237
|
mergedCreateThemeHashTable[key] =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/unplugin",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.5",
|
|
4
4
|
"description": "Universal Plumeria plugin for various build tools",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
],
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"unplugin": "^3.0.0",
|
|
89
|
-
"@plumeria/utils": "^12.0.
|
|
89
|
+
"@plumeria/utils": "^12.0.5"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@rollup/pluginutils": "^5.3.0",
|