tailwindcss-injector 0.1.2 → 0.1.3
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 +30 -15
- package/dist/postcss.js +30 -15
- package/package.json +1 -1
package/dist/postcss.cjs
CHANGED
|
@@ -216,11 +216,14 @@ var require_set_value = __commonJS({
|
|
|
216
216
|
// src/postcss.ts
|
|
217
217
|
init_cjs_shims();
|
|
218
218
|
var import_set_value = __toESM(require_set_value(), 1);
|
|
219
|
-
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
220
219
|
var _postcss = require('postcss'); var _postcss2 = _interopRequireDefault(_postcss);
|
|
221
220
|
var _tailwindcss = require('tailwindcss'); var _tailwindcss2 = _interopRequireDefault(_tailwindcss);
|
|
222
221
|
var _tailwindcssconfig = require('tailwindcss-config');
|
|
223
222
|
|
|
223
|
+
// src/config.ts
|
|
224
|
+
init_cjs_shims();
|
|
225
|
+
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
226
|
+
|
|
224
227
|
// src/utils.ts
|
|
225
228
|
init_cjs_shims();
|
|
226
229
|
var _crypto = require('crypto'); var _crypto2 = _interopRequireDefault(_crypto);
|
|
@@ -321,6 +324,24 @@ function md5(input) {
|
|
|
321
324
|
return hash.digest("hex");
|
|
322
325
|
}
|
|
323
326
|
|
|
327
|
+
// src/config.ts
|
|
328
|
+
function getDefaultConfig() {
|
|
329
|
+
return {
|
|
330
|
+
filter: () => true,
|
|
331
|
+
config: void 0,
|
|
332
|
+
directiveParams: ["utilities", "components"],
|
|
333
|
+
cwd: _process2.default.cwd(),
|
|
334
|
+
extensions: ["wxml", "js", "ts"]
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
function getConfig(options) {
|
|
338
|
+
return defuOverrideArray(options, getDefaultConfig());
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// src/constants.ts
|
|
342
|
+
init_cjs_shims();
|
|
343
|
+
var postcssPlugin = "postcss-tailwindcss-injector";
|
|
344
|
+
|
|
324
345
|
// src/wxml.ts
|
|
325
346
|
init_cjs_shims();
|
|
326
347
|
|
|
@@ -419,19 +440,13 @@ async function getDepFiles(file) {
|
|
|
419
440
|
|
|
420
441
|
// src/postcss.ts
|
|
421
442
|
var creator = (options) => {
|
|
422
|
-
const { config, filter, directiveParams, cwd, extensions } =
|
|
423
|
-
filter: () => true,
|
|
424
|
-
config: void 0,
|
|
425
|
-
directiveParams: ["utilities", "components"],
|
|
426
|
-
cwd: _process2.default.cwd(),
|
|
427
|
-
extensions: ["wxml", "js", "ts"]
|
|
428
|
-
});
|
|
443
|
+
const { config, filter, directiveParams, cwd, extensions } = getConfig(options);
|
|
429
444
|
const extensionsGlob = `{${extensions.join(",")}}`;
|
|
430
445
|
return {
|
|
431
|
-
postcssPlugin
|
|
446
|
+
postcssPlugin,
|
|
432
447
|
plugins: [
|
|
433
448
|
{
|
|
434
|
-
postcssPlugin:
|
|
449
|
+
postcssPlugin: `${postcssPlugin}:post`,
|
|
435
450
|
async Once(root, helpers) {
|
|
436
451
|
if (filter(_optionalChain([root, 'access', _ => _.source, 'optionalAccess', _2 => _2.input]))) {
|
|
437
452
|
for (const params of directiveParams) {
|
|
@@ -463,12 +478,12 @@ var creator = (options) => {
|
|
|
463
478
|
tailwindcssConfig.content.push(`${removeFileExtension(dep)}.${extensionsGlob}`);
|
|
464
479
|
}
|
|
465
480
|
}
|
|
481
|
+
await _postcss2.default.call(void 0, [
|
|
482
|
+
_tailwindcss2.default.call(void 0, tailwindcssConfig)
|
|
483
|
+
]).process(root, {
|
|
484
|
+
from: root.source.input.file
|
|
485
|
+
});
|
|
466
486
|
}
|
|
467
|
-
await _postcss2.default.call(void 0, [
|
|
468
|
-
_tailwindcss2.default.call(void 0, tailwindcssConfig)
|
|
469
|
-
]).process(root, {
|
|
470
|
-
from: _optionalChain([root, 'access', _7 => _7.source, 'optionalAccess', _8 => _8.input, 'access', _9 => _9.file])
|
|
471
|
-
});
|
|
472
487
|
}
|
|
473
488
|
}
|
|
474
489
|
}
|
package/dist/postcss.js
CHANGED
|
@@ -216,11 +216,14 @@ var require_set_value = __commonJS({
|
|
|
216
216
|
// src/postcss.ts
|
|
217
217
|
init_esm_shims();
|
|
218
218
|
var import_set_value = __toESM(require_set_value(), 1);
|
|
219
|
-
import process from "node:process";
|
|
220
219
|
import postcss from "postcss";
|
|
221
220
|
import tailwindcss from "tailwindcss";
|
|
222
221
|
import { loadConfig } from "tailwindcss-config";
|
|
223
222
|
|
|
223
|
+
// src/config.ts
|
|
224
|
+
init_esm_shims();
|
|
225
|
+
import process from "node:process";
|
|
226
|
+
|
|
224
227
|
// src/utils.ts
|
|
225
228
|
init_esm_shims();
|
|
226
229
|
import crypto from "node:crypto";
|
|
@@ -321,6 +324,24 @@ function md5(input) {
|
|
|
321
324
|
return hash.digest("hex");
|
|
322
325
|
}
|
|
323
326
|
|
|
327
|
+
// src/config.ts
|
|
328
|
+
function getDefaultConfig() {
|
|
329
|
+
return {
|
|
330
|
+
filter: () => true,
|
|
331
|
+
config: void 0,
|
|
332
|
+
directiveParams: ["utilities", "components"],
|
|
333
|
+
cwd: process.cwd(),
|
|
334
|
+
extensions: ["wxml", "js", "ts"]
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
function getConfig(options) {
|
|
338
|
+
return defuOverrideArray(options, getDefaultConfig());
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// src/constants.ts
|
|
342
|
+
init_esm_shims();
|
|
343
|
+
var postcssPlugin = "postcss-tailwindcss-injector";
|
|
344
|
+
|
|
324
345
|
// src/wxml.ts
|
|
325
346
|
init_esm_shims();
|
|
326
347
|
import path2 from "node:path";
|
|
@@ -419,19 +440,13 @@ async function getDepFiles(file) {
|
|
|
419
440
|
|
|
420
441
|
// src/postcss.ts
|
|
421
442
|
var creator = (options) => {
|
|
422
|
-
const { config, filter, directiveParams, cwd, extensions } =
|
|
423
|
-
filter: () => true,
|
|
424
|
-
config: void 0,
|
|
425
|
-
directiveParams: ["utilities", "components"],
|
|
426
|
-
cwd: process.cwd(),
|
|
427
|
-
extensions: ["wxml", "js", "ts"]
|
|
428
|
-
});
|
|
443
|
+
const { config, filter, directiveParams, cwd, extensions } = getConfig(options);
|
|
429
444
|
const extensionsGlob = `{${extensions.join(",")}}`;
|
|
430
445
|
return {
|
|
431
|
-
postcssPlugin
|
|
446
|
+
postcssPlugin,
|
|
432
447
|
plugins: [
|
|
433
448
|
{
|
|
434
|
-
postcssPlugin:
|
|
449
|
+
postcssPlugin: `${postcssPlugin}:post`,
|
|
435
450
|
async Once(root, helpers) {
|
|
436
451
|
if (filter(root.source?.input)) {
|
|
437
452
|
for (const params of directiveParams) {
|
|
@@ -463,12 +478,12 @@ var creator = (options) => {
|
|
|
463
478
|
tailwindcssConfig.content.push(`${removeFileExtension(dep)}.${extensionsGlob}`);
|
|
464
479
|
}
|
|
465
480
|
}
|
|
481
|
+
await postcss([
|
|
482
|
+
tailwindcss(tailwindcssConfig)
|
|
483
|
+
]).process(root, {
|
|
484
|
+
from: root.source.input.file
|
|
485
|
+
});
|
|
466
486
|
}
|
|
467
|
-
await postcss([
|
|
468
|
-
tailwindcss(tailwindcssConfig)
|
|
469
|
-
]).process(root, {
|
|
470
|
-
from: root.source?.input.file
|
|
471
|
-
});
|
|
472
487
|
}
|
|
473
488
|
}
|
|
474
489
|
}
|