tailwindcss-injector 0.1.6-alpha.5 → 1.0.0-alpha.6

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/postcss.cjs CHANGED
@@ -229,57 +229,57 @@ init_cjs_shims();
229
229
  var _crypto = require('crypto'); var _crypto2 = _interopRequireDefault(_crypto);
230
230
  var _shared = require('@weapp-tailwindcss/shared');
231
231
 
232
- // ../../node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/index.mjs
232
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
233
233
  init_cjs_shims();
234
234
 
235
- // ../../node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.mjs
235
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
236
236
  init_cjs_shims();
237
237
  var _lazyMatch = () => {
238
238
  var __lib__ = (() => {
239
239
  var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
240
240
  for (var n in e) m(r, n, { get: e[n], enumerable: true });
241
- }, H = (r, e, n, t) => {
242
- if (typeof e == "object" || typeof e == "function") for (let a of G(e)) !T.call(r, a) && a !== n && m(r, a, { get: () => e[a], enumerable: !(t = V(e, a)) || t.enumerable });
241
+ }, H = (r, e, n, a) => {
242
+ if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
243
243
  return r;
244
244
  }, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
245
- q(w, { zeptomatch: () => re });
245
+ q(w, { default: () => re });
246
246
  var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
247
247
  const e = /* @__PURE__ */ new Map();
248
248
  return (n) => {
249
- const t = e.get(n);
250
- if (t) return t;
251
- const a = r(n);
252
- return e.set(n, a), a;
249
+ const a = e.get(n);
250
+ if (a) return a;
251
+ const t = r(n);
252
+ return e.set(n, t), t;
253
253
  };
254
254
  }, rr = (r, e, n = {}) => {
255
- const t = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
256
- if (v(e)(t) && t.index === r.length) return t.output;
257
- throw new Error(`Failed to parse at index ${t.indexMax}`);
258
- }, i = (r, e) => A(r) ? er(r, e) : b(r) ? tr(r, e) : nr(r, e), er = (r, e) => {
255
+ const a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
256
+ if (v(e)(a) && a.index === r.length) return a.output;
257
+ throw new Error(`Failed to parse at index ${a.indexMax}`);
258
+ }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
259
259
  const n = {};
260
- for (const t of r) {
261
- if (t.length !== 1) throw new Error(`Invalid character: "${t}"`);
262
- const a = t.charCodeAt(0);
263
- n[a] = true;
260
+ for (const a of r) {
261
+ if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
262
+ const t = a.charCodeAt(0);
263
+ n[t] = true;
264
264
  }
265
- return (t) => {
266
- const a = t.index, o = t.input;
267
- for (; t.index < o.length && o.charCodeAt(t.index) in n; ) t.index += 1;
268
- const u = t.index;
269
- if (u > a) {
270
- if (!h(e) && !t.options.silent) {
271
- const s = t.input.slice(a, u), c = d(e) ? e(s, o, String(a)) : e;
272
- h(c) || t.output.push(c);
265
+ return (a) => {
266
+ const t = a.index, o = a.input;
267
+ for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
268
+ const u = a.index;
269
+ if (u > t) {
270
+ if (!h(e) && !a.options.silent) {
271
+ const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
272
+ h(c) || a.output.push(c);
273
273
  }
274
- t.indexMax = Math.max(t.indexMax, t.index);
274
+ a.indexMax = Math.max(a.indexMax, a.index);
275
275
  }
276
276
  return true;
277
277
  };
278
278
  }, nr = (r, e) => {
279
- const n = r.source, t = r.flags.replace(/y|$/, "y"), a = new RegExp(n, t);
279
+ const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
280
280
  return g((o) => {
281
- a.lastIndex = o.index;
282
- const u = a.exec(o.input);
281
+ t.lastIndex = o.index;
282
+ const u = t.exec(o.input);
283
283
  if (u) {
284
284
  if (!h(e) && !o.options.silent) {
285
285
  const s = d(e) ? e(...u, o.input, String(o.index)) : e;
@@ -288,41 +288,41 @@ var _lazyMatch = () => {
288
288
  return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
289
289
  } else return false;
290
290
  });
291
- }, tr = (r, e) => (n) => {
291
+ }, ar = (r, e) => (n) => {
292
292
  if (n.input.startsWith(r, n.index)) {
293
293
  if (!h(e) && !n.options.silent) {
294
- const a = d(e) ? e(r, n.input, String(n.index)) : e;
295
- h(a) || n.output.push(a);
294
+ const t = d(e) ? e(r, n.input, String(n.index)) : e;
295
+ h(t) || n.output.push(t);
296
296
  }
297
297
  return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
298
298
  } else return false;
299
- }, C = (r, e, n, t) => {
300
- const a = v(r);
299
+ }, C = (r, e, n, a) => {
300
+ const t = v(r);
301
301
  return g(_(M((o) => {
302
302
  let u = 0;
303
303
  for (; u < n; ) {
304
304
  const s = o.index;
305
- if (!a(o) || (u += 1, o.index === s)) break;
305
+ if (!t(o) || (u += 1, o.index === s)) break;
306
306
  }
307
307
  return u >= e;
308
308
  })));
309
- }, ar = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
309
+ }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
310
310
  const n = r.map(v);
311
- return g(_(M((t) => {
312
- for (let a = 0, o = n.length; a < o; a++) if (!n[a](t)) return false;
311
+ return g(_(M((a) => {
312
+ for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
313
313
  return true;
314
314
  })));
315
315
  }, l = (r, e) => {
316
316
  const n = r.map(v);
317
- return g(_((t) => {
318
- for (let a = 0, o = n.length; a < o; a++) if (n[a](t)) return true;
317
+ return g(_((a) => {
318
+ for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return true;
319
319
  return false;
320
320
  }));
321
321
  }, M = (r, e = false) => {
322
322
  const n = v(r);
323
- return (t) => {
324
- const a = t.index, o = t.output.length, u = n(t);
325
- return (!u || e) && (t.index = a, t.output.length !== o && (t.output.length = o)), u;
323
+ return (a) => {
324
+ const t = a.index, o = a.output.length, u = n(a);
325
+ return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
326
326
  };
327
327
  }, _ = (r, e) => {
328
328
  const n = v(r);
@@ -330,20 +330,20 @@ var _lazyMatch = () => {
330
330
  }, g = /* @__PURE__ */ (() => {
331
331
  let r = 0;
332
332
  return (e) => {
333
- const n = v(e), t = r += 1;
334
- return (a) => {
333
+ const n = v(e), a = r += 1;
334
+ return (t) => {
335
335
  var o;
336
- if (a.options.memoization === false) return n(a);
337
- const u = a.index, s = (o = a.cache)[t] || (o[t] = /* @__PURE__ */ new Map()), c = s.get(u);
336
+ if (t.options.memoization === false) return n(t);
337
+ const u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
338
338
  if (c === false) return false;
339
- if (W(c)) return a.index = c, true;
340
- if (c) return a.index = c.index, _optionalChain([c, 'access', _2 => _2.output, 'optionalAccess', _3 => _3.length]) && a.output.push(...c.output), true;
339
+ if (W(c)) return t.index = c, true;
340
+ if (c) return t.index = c.index, _optionalChain([c, 'access', _2 => _2.output, 'optionalAccess', _3 => _3.length]) && t.output.push(...c.output), true;
341
341
  {
342
- const Z = a.output.length;
343
- if (n(a)) {
344
- const D = a.index, U = a.output.length;
342
+ const Z = t.output.length;
343
+ if (n(t)) {
344
+ const D = t.index, U = t.output.length;
345
345
  if (U > Z) {
346
- const ee = a.output.slice(Z, U);
346
+ const ee = t.output.slice(Z, U);
347
347
  s.set(u, { index: D, output: ee });
348
348
  } else s.set(u, D);
349
349
  return true;
@@ -367,23 +367,23 @@ var _lazyMatch = () => {
367
367
  e = P[n] + e, r = Math.floor((r - 1) / 26);
368
368
  }
369
369
  return e;
370
- }, z = (r) => {
370
+ }, O = (r) => {
371
371
  let e = 0;
372
- for (let n = 0, t = r.length; n < t; n++) e = e * 26 + P.indexOf(r[n]) + 1;
372
+ for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
373
373
  return e;
374
374
  }, S = (r, e) => {
375
375
  if (e < r) return S(e, r);
376
376
  const n = [];
377
377
  for (; r <= e; ) n.push(r++);
378
378
  return n;
379
- }, or = (r, e, n) => S(r, e).map((t) => String(t).padStart(n, "0")), O = (r, e) => S(z(r), z(e)).map(ir), p = (r) => r, R = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
379
+ }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
380
380
  const e = {};
381
381
  return (n) => _nullishCoalesce(e[n], () => ( (e[n] = r(n))));
382
- }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, t) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${t.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, ar(Ar), f(Er), wr]), Pr = i("{", "(?:"), zr = i("}", ")"), Or = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), Rr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => O(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => O(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Or, Rr, jr]), I = x([Pr, Nr, zr]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = R(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = R(Kr), Yr = Xr, $ = (r, e) => {
382
+ }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
383
383
  const n = Array.isArray(r) ? r : [r];
384
384
  if (!n.length) return false;
385
- const t = n.map($.compile), a = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, a ? "/" : "");
386
- return t.some((s) => s.test(o));
385
+ const a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
386
+ return a.some((s) => s.test(o));
387
387
  };
388
388
  $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
389
389
  var re = $;
@@ -635,7 +635,7 @@ var _path = {
635
635
  toNamespacedPath
636
636
  };
637
637
 
638
- // ../../node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/index.mjs
638
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
639
639
  var delimiter = /* @__PURE__ */ (() => _optionalChain([globalThis, 'access', _9 => _9.process, 'optionalAccess', _10 => _10.platform]) === "win32" ? ";" : ":")();
640
640
  var _platforms = { posix: void 0, win32: void 0 };
641
641
  var mix = (del = delimiter) => {
@@ -817,10 +817,13 @@ var creator = (options) => {
817
817
  const cfg = typeof config === "function" ? config(_optionalChain([root, 'access', _13 => _13.source, 'optionalAccess', _14 => _14.input])) : config;
818
818
  let tailwindcssConfig;
819
819
  if (typeof cfg === "string") {
820
- tailwindcssConfig = await _tailwindcssconfig.loadConfig.call(void 0, {
820
+ const result = await _tailwindcssconfig.loadConfig.call(void 0, {
821
821
  cwd: cwd2,
822
822
  config: cfg
823
823
  });
824
+ if (result) {
825
+ tailwindcssConfig = result.config;
826
+ }
824
827
  } else {
825
828
  tailwindcssConfig = _nullishCoalesce(cfg, () => ( {
826
829
  content: []
package/dist/postcss.js CHANGED
@@ -229,57 +229,57 @@ init_esm_shims();
229
229
  import crypto from "node:crypto";
230
230
  import { defu, defuOverrideArray, isRegexp, regExpTest } from "@weapp-tailwindcss/shared";
231
231
 
232
- // ../../node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/index.mjs
232
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
233
233
  init_esm_shims();
234
234
 
235
- // ../../node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.mjs
235
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
236
236
  init_esm_shims();
237
237
  var _lazyMatch = () => {
238
238
  var __lib__ = (() => {
239
239
  var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e) => {
240
240
  for (var n in e) m(r, n, { get: e[n], enumerable: true });
241
- }, H = (r, e, n, t) => {
242
- if (typeof e == "object" || typeof e == "function") for (let a of G(e)) !T.call(r, a) && a !== n && m(r, a, { get: () => e[a], enumerable: !(t = V(e, a)) || t.enumerable });
241
+ }, H = (r, e, n, a) => {
242
+ if (e && typeof e == "object" || typeof e == "function") for (let t of G(e)) !T.call(r, t) && t !== n && m(r, t, { get: () => e[t], enumerable: !(a = V(e, t)) || a.enumerable });
243
243
  return r;
244
244
  }, J = (r) => H(m({}, "__esModule", { value: true }), r), w = {};
245
- q(w, { zeptomatch: () => re });
245
+ q(w, { default: () => re });
246
246
  var A = (r) => Array.isArray(r), d = (r) => typeof r == "function", Q = (r) => r.length === 0, W = (r) => typeof r == "number", K = (r) => typeof r == "object" && r !== null, X = (r) => r instanceof RegExp, b = (r) => typeof r == "string", h = (r) => r === void 0, Y = (r) => {
247
247
  const e = /* @__PURE__ */ new Map();
248
248
  return (n) => {
249
- const t = e.get(n);
250
- if (t) return t;
251
- const a = r(n);
252
- return e.set(n, a), a;
249
+ const a = e.get(n);
250
+ if (a) return a;
251
+ const t = r(n);
252
+ return e.set(n, t), t;
253
253
  };
254
254
  }, rr = (r, e, n = {}) => {
255
- const t = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
256
- if (v(e)(t) && t.index === r.length) return t.output;
257
- throw new Error(`Failed to parse at index ${t.indexMax}`);
258
- }, i = (r, e) => A(r) ? er(r, e) : b(r) ? tr(r, e) : nr(r, e), er = (r, e) => {
255
+ const a = { cache: {}, input: r, index: 0, indexMax: 0, options: n, output: [] };
256
+ if (v(e)(a) && a.index === r.length) return a.output;
257
+ throw new Error(`Failed to parse at index ${a.indexMax}`);
258
+ }, i = (r, e) => A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e) => {
259
259
  const n = {};
260
- for (const t of r) {
261
- if (t.length !== 1) throw new Error(`Invalid character: "${t}"`);
262
- const a = t.charCodeAt(0);
263
- n[a] = true;
260
+ for (const a of r) {
261
+ if (a.length !== 1) throw new Error(`Invalid character: "${a}"`);
262
+ const t = a.charCodeAt(0);
263
+ n[t] = true;
264
264
  }
265
- return (t) => {
266
- const a = t.index, o = t.input;
267
- for (; t.index < o.length && o.charCodeAt(t.index) in n; ) t.index += 1;
268
- const u = t.index;
269
- if (u > a) {
270
- if (!h(e) && !t.options.silent) {
271
- const s = t.input.slice(a, u), c = d(e) ? e(s, o, String(a)) : e;
272
- h(c) || t.output.push(c);
265
+ return (a) => {
266
+ const t = a.index, o = a.input;
267
+ for (; a.index < o.length && o.charCodeAt(a.index) in n; ) a.index += 1;
268
+ const u = a.index;
269
+ if (u > t) {
270
+ if (!h(e) && !a.options.silent) {
271
+ const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
272
+ h(c) || a.output.push(c);
273
273
  }
274
- t.indexMax = Math.max(t.indexMax, t.index);
274
+ a.indexMax = Math.max(a.indexMax, a.index);
275
275
  }
276
276
  return true;
277
277
  };
278
278
  }, nr = (r, e) => {
279
- const n = r.source, t = r.flags.replace(/y|$/, "y"), a = new RegExp(n, t);
279
+ const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
280
280
  return g((o) => {
281
- a.lastIndex = o.index;
282
- const u = a.exec(o.input);
281
+ t.lastIndex = o.index;
282
+ const u = t.exec(o.input);
283
283
  if (u) {
284
284
  if (!h(e) && !o.options.silent) {
285
285
  const s = d(e) ? e(...u, o.input, String(o.index)) : e;
@@ -288,41 +288,41 @@ var _lazyMatch = () => {
288
288
  return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
289
289
  } else return false;
290
290
  });
291
- }, tr = (r, e) => (n) => {
291
+ }, ar = (r, e) => (n) => {
292
292
  if (n.input.startsWith(r, n.index)) {
293
293
  if (!h(e) && !n.options.silent) {
294
- const a = d(e) ? e(r, n.input, String(n.index)) : e;
295
- h(a) || n.output.push(a);
294
+ const t = d(e) ? e(r, n.input, String(n.index)) : e;
295
+ h(t) || n.output.push(t);
296
296
  }
297
297
  return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
298
298
  } else return false;
299
- }, C = (r, e, n, t) => {
300
- const a = v(r);
299
+ }, C = (r, e, n, a) => {
300
+ const t = v(r);
301
301
  return g(_(M((o) => {
302
302
  let u = 0;
303
303
  for (; u < n; ) {
304
304
  const s = o.index;
305
- if (!a(o) || (u += 1, o.index === s)) break;
305
+ if (!t(o) || (u += 1, o.index === s)) break;
306
306
  }
307
307
  return u >= e;
308
308
  })));
309
- }, ar = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
309
+ }, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
310
310
  const n = r.map(v);
311
- return g(_(M((t) => {
312
- for (let a = 0, o = n.length; a < o; a++) if (!n[a](t)) return false;
311
+ return g(_(M((a) => {
312
+ for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
313
313
  return true;
314
314
  })));
315
315
  }, l = (r, e) => {
316
316
  const n = r.map(v);
317
- return g(_((t) => {
318
- for (let a = 0, o = n.length; a < o; a++) if (n[a](t)) return true;
317
+ return g(_((a) => {
318
+ for (let t = 0, o = n.length; t < o; t++) if (n[t](a)) return true;
319
319
  return false;
320
320
  }));
321
321
  }, M = (r, e = false) => {
322
322
  const n = v(r);
323
- return (t) => {
324
- const a = t.index, o = t.output.length, u = n(t);
325
- return (!u || e) && (t.index = a, t.output.length !== o && (t.output.length = o)), u;
323
+ return (a) => {
324
+ const t = a.index, o = a.output.length, u = n(a);
325
+ return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
326
326
  };
327
327
  }, _ = (r, e) => {
328
328
  const n = v(r);
@@ -330,20 +330,20 @@ var _lazyMatch = () => {
330
330
  }, g = /* @__PURE__ */ (() => {
331
331
  let r = 0;
332
332
  return (e) => {
333
- const n = v(e), t = r += 1;
334
- return (a) => {
333
+ const n = v(e), a = r += 1;
334
+ return (t) => {
335
335
  var o;
336
- if (a.options.memoization === false) return n(a);
337
- const u = a.index, s = (o = a.cache)[t] || (o[t] = /* @__PURE__ */ new Map()), c = s.get(u);
336
+ if (t.options.memoization === false) return n(t);
337
+ const u = t.index, s = (o = t.cache)[a] || (o[a] = /* @__PURE__ */ new Map()), c = s.get(u);
338
338
  if (c === false) return false;
339
- if (W(c)) return a.index = c, true;
340
- if (c) return a.index = c.index, c.output?.length && a.output.push(...c.output), true;
339
+ if (W(c)) return t.index = c, true;
340
+ if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), true;
341
341
  {
342
- const Z = a.output.length;
343
- if (n(a)) {
344
- const D = a.index, U = a.output.length;
342
+ const Z = t.output.length;
343
+ if (n(t)) {
344
+ const D = t.index, U = t.output.length;
345
345
  if (U > Z) {
346
- const ee = a.output.slice(Z, U);
346
+ const ee = t.output.slice(Z, U);
347
347
  s.set(u, { index: D, output: ee });
348
348
  } else s.set(u, D);
349
349
  return true;
@@ -367,23 +367,23 @@ var _lazyMatch = () => {
367
367
  e = P[n] + e, r = Math.floor((r - 1) / 26);
368
368
  }
369
369
  return e;
370
- }, z = (r) => {
370
+ }, O = (r) => {
371
371
  let e = 0;
372
- for (let n = 0, t = r.length; n < t; n++) e = e * 26 + P.indexOf(r[n]) + 1;
372
+ for (let n = 0, a = r.length; n < a; n++) e = e * 26 + P.indexOf(r[n]) + 1;
373
373
  return e;
374
374
  }, S = (r, e) => {
375
375
  if (e < r) return S(e, r);
376
376
  const n = [];
377
377
  for (; r <= e; ) n.push(r++);
378
378
  return n;
379
- }, or = (r, e, n) => S(r, e).map((t) => String(t).padStart(n, "0")), O = (r, e) => S(z(r), z(e)).map(ir), p = (r) => r, R = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
379
+ }, or = (r, e, n) => S(r, e).map((a) => String(a).padStart(n, "0")), R = (r, e) => S(O(r), O(e)).map(ir), p = (r) => r, z = (r) => ur((e) => rr(e, r, { memoization: false }).join("")), ur = (r) => {
380
380
  const e = {};
381
381
  return (n) => e[n] ?? (e[n] = r(n));
382
- }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, t) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${t.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, ar(Ar), f(Er), wr]), Pr = i("{", "(?:"), zr = i("}", ")"), Or = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), Rr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => O(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => O(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Or, Rr, jr]), I = x([Pr, Nr, zr]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = R(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = R(Kr), Yr = Xr, $ = (r, e) => {
382
+ }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a) => `.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r) => `\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e) => `(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([hr, dr]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([xr, gr, mr, _r]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([Sr, yr]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r) => `\\${r}`), Mr = i(/[^\]]/, p), Er = l([y, Cr, br, Mr]), B = x([$r, tr(Ar), f(Er), wr]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n) => or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n) => R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n) => R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([Rr, zr, jr]), I = x([Pr, Nr, Or]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r) => `\\${r}`), Lr = i(/[^}]/, p), Zr = E(() => F), Dr = l([j, N, k, B, I, Zr, y, Fr, Ir, Lr]), F = x([kr, f(Dr), Br]), Ur = f(l([sr, cr, lr, fr, j, N, k, B, I, F, y, pr, vr])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e) => `${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e) => `${e}*`), Wr = f(l([Tr, Hr, Jr, Qr, qr])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e) => {
383
383
  const n = Array.isArray(r) ? r : [r];
384
384
  if (!n.length) return false;
385
- const t = n.map($.compile), a = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, a ? "/" : "");
386
- return t.some((s) => s.test(o));
385
+ const a = n.map($.compile), t = n.every((s) => /(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
386
+ return a.some((s) => s.test(o));
387
387
  };
388
388
  $.compile = (r) => new RegExp(`^${L(Yr(r))}$`, "s");
389
389
  var re = $;
@@ -635,7 +635,7 @@ var _path = {
635
635
  toNamespacedPath
636
636
  };
637
637
 
638
- // ../../node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/index.mjs
638
+ // ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
639
639
  var delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
640
640
  var _platforms = { posix: void 0, win32: void 0 };
641
641
  var mix = (del = delimiter) => {
@@ -817,10 +817,13 @@ var creator = (options) => {
817
817
  const cfg = typeof config === "function" ? config(root.source?.input) : config;
818
818
  let tailwindcssConfig;
819
819
  if (typeof cfg === "string") {
820
- tailwindcssConfig = await loadConfig({
820
+ const result = await loadConfig({
821
821
  cwd: cwd2,
822
822
  config: cfg
823
823
  });
824
+ if (result) {
825
+ tailwindcssConfig = result.config;
826
+ }
824
827
  } else {
825
828
  tailwindcssConfig = cfg ?? {
826
829
  content: []
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tailwindcss-injector",
3
3
  "type": "module",
4
- "version": "0.1.6-alpha.5",
4
+ "version": "1.0.0-alpha.6",
5
5
  "description": "tsup(esbuild) build package template",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "postcss": "^8.5.2",
38
38
  "tailwindcss": "^3.4.17",
39
39
  "@weapp-tailwindcss/shared": "1.0.0-alpha.4",
40
- "tailwindcss-config": "0.0.0"
40
+ "tailwindcss-config": "1.0.0-alpha.0"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "tsup --watch --sourcemap",