@tailwindcss-mangle/config 6.0.0 → 6.0.1

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/index.cjs CHANGED
@@ -41,7 +41,6 @@ __export(index_exports, {
41
41
  module.exports = __toCommonJS(index_exports);
42
42
 
43
43
  // src/config.ts
44
- var import_c12 = require("c12");
45
44
  var import_fs_extra = __toESM(require("fs-extra"), 1);
46
45
  var import_pathe = __toESM(require("pathe"), 1);
47
46
 
@@ -97,8 +96,16 @@ function getDefaultUserConfig() {
97
96
  }
98
97
 
99
98
  // src/config.ts
100
- function getConfig(cwd) {
101
- return (0, import_c12.loadConfig)({
99
+ var c12Promise;
100
+ async function loadC12() {
101
+ if (!c12Promise) {
102
+ c12Promise = import("c12");
103
+ }
104
+ return c12Promise;
105
+ }
106
+ async function getConfig(cwd) {
107
+ const { loadConfig } = await loadC12();
108
+ return loadConfig({
102
109
  name: CONFIG_NAME,
103
110
  defaults: {
104
111
  ...getDefaultUserConfig()
@@ -106,7 +113,7 @@ function getConfig(cwd) {
106
113
  cwd
107
114
  });
108
115
  }
109
- var defineConfig = (0, import_c12.createDefineConfig)();
116
+ var defineConfig = (config) => config;
110
117
  function initConfig(cwd) {
111
118
  return import_fs_extra.default.outputFile(
112
119
  import_pathe.default.resolve(cwd, `${CONFIG_NAME}.config.ts`),
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as c12 from 'c12';
1
+ import { ResolvedConfig, createDefineConfig } from 'c12';
2
2
  import { FilterPattern } from '@rollup/pluginutils';
3
3
  import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
4
4
  import { SourceEntry } from '@tailwindcss/oxide';
@@ -70,8 +70,9 @@ interface TailwindcssMangleConfig {
70
70
  }
71
71
  type UserConfig = TailwindcssMangleConfig;
72
72
 
73
- declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>>;
74
- declare const defineConfig: c12.DefineConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>;
73
+ type DefineConfig = ReturnType<typeof createDefineConfig<TailwindcssMangleConfig>>;
74
+ declare function getConfig(cwd?: string): Promise<ResolvedConfig<TailwindcssMangleConfig>>;
75
+ declare const defineConfig: DefineConfig;
75
76
  declare function initConfig(cwd: string): Promise<void>;
76
77
 
77
78
  declare const CONFIG_NAME = "tailwindcss-mangle";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as c12 from 'c12';
1
+ import { ResolvedConfig, createDefineConfig } from 'c12';
2
2
  import { FilterPattern } from '@rollup/pluginutils';
3
3
  import { IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
4
4
  import { SourceEntry } from '@tailwindcss/oxide';
@@ -70,8 +70,9 @@ interface TailwindcssMangleConfig {
70
70
  }
71
71
  type UserConfig = TailwindcssMangleConfig;
72
72
 
73
- declare function getConfig(cwd?: string): Promise<c12.ResolvedConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>>;
74
- declare const defineConfig: c12.DefineConfig<TailwindcssMangleConfig, c12.ConfigLayerMeta>;
73
+ type DefineConfig = ReturnType<typeof createDefineConfig<TailwindcssMangleConfig>>;
74
+ declare function getConfig(cwd?: string): Promise<ResolvedConfig<TailwindcssMangleConfig>>;
75
+ declare const defineConfig: DefineConfig;
75
76
  declare function initConfig(cwd: string): Promise<void>;
76
77
 
77
78
  declare const CONFIG_NAME = "tailwindcss-mangle";
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  // src/config.ts
2
- import { createDefineConfig, loadConfig } from "c12";
3
2
  import fs from "fs-extra";
4
3
  import path from "pathe";
5
4
 
@@ -55,7 +54,15 @@ function getDefaultUserConfig() {
55
54
  }
56
55
 
57
56
  // src/config.ts
58
- function getConfig(cwd) {
57
+ var c12Promise;
58
+ async function loadC12() {
59
+ if (!c12Promise) {
60
+ c12Promise = import("c12");
61
+ }
62
+ return c12Promise;
63
+ }
64
+ async function getConfig(cwd) {
65
+ const { loadConfig } = await loadC12();
59
66
  return loadConfig({
60
67
  name: CONFIG_NAME,
61
68
  defaults: {
@@ -64,7 +71,7 @@ function getConfig(cwd) {
64
71
  cwd
65
72
  });
66
73
  }
67
- var defineConfig = createDefineConfig();
74
+ var defineConfig = (config) => config;
68
75
  function initConfig(cwd) {
69
76
  return fs.outputFile(
70
77
  path.resolve(cwd, `${CONFIG_NAME}.config.ts`),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tailwindcss-mangle/config",
3
3
  "type": "module",
4
- "version": "6.0.0",
4
+ "version": "6.0.1",
5
5
  "description": "The config and load function of tailwindcss-mangle",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",