tailwindcss-patch 2.0.2 → 2.0.4

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/cli.cjs CHANGED
@@ -14,6 +14,7 @@ const config = require('@tailwindcss-mangle/config');
14
14
  require('semver');
15
15
  require('postcss');
16
16
  require('lilconfig');
17
+ require('jiti');
17
18
 
18
19
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
19
20
 
package/dist/cli.mjs CHANGED
@@ -12,6 +12,7 @@ import { configName, getConfig, initConfig } from '@tailwindcss-mangle/config';
12
12
  import 'semver';
13
13
  import 'postcss';
14
14
  import 'lilconfig';
15
+ import 'jiti';
15
16
 
16
17
  function init() {
17
18
  const cwd = process.cwd();
package/dist/index.cjs CHANGED
@@ -11,6 +11,7 @@ const traverse = require('@babel/traverse');
11
11
  const parser = require('@babel/parser');
12
12
  const postcss = require('postcss');
13
13
  const lilconfig = require('lilconfig');
14
+ const createJiti = require('jiti');
14
15
  const config = require('@tailwindcss-mangle/config');
15
16
 
16
17
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
@@ -35,6 +36,7 @@ const t__namespace = /*#__PURE__*/_interopNamespaceCompat(t);
35
36
  const generate__default = /*#__PURE__*/_interopDefaultCompat(generate);
36
37
  const traverse__default = /*#__PURE__*/_interopDefaultCompat(traverse);
37
38
  const postcss__default = /*#__PURE__*/_interopDefaultCompat(postcss);
39
+ const createJiti__default = /*#__PURE__*/_interopDefaultCompat(createJiti);
38
40
 
39
41
  const { sync } = pkg__default;
40
42
  function ensureFileContent(filepaths) {
@@ -441,6 +443,7 @@ function internalPatch(pkgJsonPath, options) {
441
443
  }
442
444
  }
443
445
 
446
+ const jiti = createJiti__default(__filename);
444
447
  async function processTailwindcss(options) {
445
448
  options.cwd = options.cwd ?? process.cwd();
446
449
  let config = options.config;
@@ -450,8 +453,10 @@ async function processTailwindcss(options) {
450
453
  searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.cjs`],
451
454
  loaders: {
452
455
  // 默认支持 js 和 cjs 2种格式
453
- ".js": require,
454
- ".cjs": require
456
+ ".js": jiti,
457
+ ".cjs": jiti,
458
+ ".ts": jiti,
459
+ ".mjs": jiti
455
460
  }
456
461
  }).search(options.cwd);
457
462
  if (!result) {
package/dist/index.mjs CHANGED
@@ -9,6 +9,7 @@ import traverse from '@babel/traverse';
9
9
  import { parse } from '@babel/parser';
10
10
  import postcss from 'postcss';
11
11
  import { lilconfig } from 'lilconfig';
12
+ import createJiti from 'jiti';
12
13
 
13
14
 
14
15
  // -- Unbuild CommonJS Shims --
@@ -425,6 +426,7 @@ function internalPatch(pkgJsonPath, options) {
425
426
  }
426
427
  }
427
428
 
429
+ const jiti = createJiti(__filename);
428
430
  async function processTailwindcss(options) {
429
431
  options.cwd = options.cwd ?? process.cwd();
430
432
  let config = options.config;
@@ -434,8 +436,10 @@ async function processTailwindcss(options) {
434
436
  searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.cjs`],
435
437
  loaders: {
436
438
  // 默认支持 js 和 cjs 2种格式
437
- ".js": require,
438
- ".cjs": require
439
+ ".js": jiti,
440
+ ".cjs": jiti,
441
+ ".ts": jiti,
442
+ ".mjs": jiti
439
443
  }
440
444
  }).search(options.cwd);
441
445
  if (!result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss-patch",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "patch tailwindcss for exposing context and extract classes",
5
5
  "exports": {
6
6
  ".": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "tailwindcss": {
48
- "optional": false
48
+ "optional": true
49
49
  }
50
50
  },
51
51
  "devDependencies": {
@@ -62,11 +62,12 @@
62
62
  "@babel/traverse": "^7.22.10",
63
63
  "@babel/types": "^7.22.10",
64
64
  "cac": "^6.7.14",
65
+ "jiti": "^1.19.1",
65
66
  "lilconfig": "^2.1.0",
66
67
  "postcss": "^8.4.27",
67
68
  "resolve": "^1.22.4",
68
69
  "semver": "^7.5.4",
69
- "@tailwindcss-mangle/config": "^1.0.0"
70
+ "@tailwindcss-mangle/config": "^2.0.4"
70
71
  },
71
72
  "homepage": "https://github.com/sonofmagic/tailwindcss-mangle",
72
73
  "repository": {
@@ -83,6 +84,6 @@
83
84
  "build": "unbuild",
84
85
  "test": "vitest run --coverage.enabled",
85
86
  "test:dev": "vitest",
86
- "cli": "node bin/tw-patch.js install"
87
+ "patch": "node bin/tw-patch.js install"
87
88
  }
88
89
  }