weapp-tailwindcss 4.0.0 → 4.0.2
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/{chunk-UJFSOSOM.mjs → chunk-3HOCRXDT.mjs} +2 -2
- package/dist/{chunk-HI4MB6DS.mjs → chunk-D6FTUNLD.mjs} +2 -2
- package/dist/{chunk-W3GZOMW4.mjs → chunk-FHP2IWTD.mjs} +24 -5
- package/dist/{chunk-AHF73IRB.js → chunk-G63AWKPG.js} +3 -3
- package/dist/{chunk-PZFXLVE2.js → chunk-MGGYACFY.js} +3 -3
- package/dist/{chunk-P3IRFH3E.js → chunk-NSZPW6UU.js} +24 -5
- package/dist/{chunk-M5OLCGMK.mjs → chunk-TFTD2FWQ.mjs} +2 -2
- package/dist/{chunk-DXVFKGNL.js → chunk-XKF5XSEO.js} +3 -3
- package/dist/cli.js +3 -3
- package/dist/cli.mjs +1 -1
- package/dist/core.d.mts +2 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +10 -6
- package/dist/core.mjs +9 -5
- package/dist/defaults.d.mts +1 -0
- package/dist/defaults.d.ts +1 -0
- package/dist/escape.d.mts +1 -0
- package/dist/escape.d.ts +1 -0
- package/dist/gulp.d.mts +1 -0
- package/dist/gulp.d.ts +1 -0
- package/dist/gulp.js +3 -3
- package/dist/gulp.mjs +2 -2
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -5
- package/dist/index.mjs +4 -4
- package/dist/types.d.mts +63 -13
- package/dist/types.d.ts +63 -13
- package/dist/vite.d.mts +1 -0
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +3 -3
- package/dist/vite.mjs +2 -2
- package/dist/webpack.d.mts +1 -0
- package/dist/webpack.d.ts +1 -0
- package/dist/webpack.js +3 -3
- package/dist/webpack.mjs +2 -2
- package/dist/webpack4.d.mts +1 -0
- package/dist/webpack4.d.ts +1 -0
- package/dist/webpack4.js +3 -3
- package/dist/webpack4.mjs +2 -2
- package/package.json +8 -8
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-HL6Y5PYZ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getCompilerContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FHP2IWTD.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getGroupedEntries,
|
|
12
12
|
removeExt
|
|
@@ -84,7 +84,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
84
84
|
}
|
|
85
85
|
const entries = Object.entries(assets);
|
|
86
86
|
const groupedEntries = getGroupedEntries(entries, this.options);
|
|
87
|
-
const runtimeSet = getClassSet();
|
|
87
|
+
const runtimeSet = yield getClassSet();
|
|
88
88
|
setMangleRuntimeSet(runtimeSet);
|
|
89
89
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
90
90
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-HL6Y5PYZ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getCompilerContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FHP2IWTD.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getGroupedEntries
|
|
12
12
|
} from "./chunk-MUJ65IQ3.mjs";
|
|
@@ -47,7 +47,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
47
47
|
onStart();
|
|
48
48
|
const entries = Object.entries(bundle);
|
|
49
49
|
const groupedEntries = getGroupedEntries(entries, opts);
|
|
50
|
-
const runtimeSet = twPatcher.getClassSet();
|
|
50
|
+
const runtimeSet = yield twPatcher.getClassSet();
|
|
51
51
|
setMangleRuntimeSet(runtimeSet);
|
|
52
52
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
53
53
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -472,8 +472,10 @@ import { getPackageInfoSync } from "local-pkg";
|
|
|
472
472
|
// src/tailwindcss/patcher.ts
|
|
473
473
|
import path from "node:path";
|
|
474
474
|
import process from "node:process";
|
|
475
|
+
import { isAllowedClassName } from "@weapp-core/escape";
|
|
475
476
|
import { TailwindcssPatcher } from "tailwindcss-patch";
|
|
476
|
-
function createTailwindcssPatcher(
|
|
477
|
+
function createTailwindcssPatcher(options) {
|
|
478
|
+
const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, resolve } = options || {};
|
|
477
479
|
const cache = {};
|
|
478
480
|
if (cacheDir) {
|
|
479
481
|
if (path.isAbsolute(cacheDir)) {
|
|
@@ -491,7 +493,18 @@ function createTailwindcssPatcher(basedir, cacheDir, supportCustomLengthUnitsPat
|
|
|
491
493
|
applyPatches: {
|
|
492
494
|
exportContext: true,
|
|
493
495
|
extendLengthUnits: supportCustomLengthUnitsPatch
|
|
496
|
+
},
|
|
497
|
+
tailwindcss,
|
|
498
|
+
resolve,
|
|
499
|
+
filter: (x) => {
|
|
500
|
+
return !isAllowedClassName(x);
|
|
494
501
|
}
|
|
502
|
+
// for example
|
|
503
|
+
// resolve: {
|
|
504
|
+
// paths: [
|
|
505
|
+
// import.meta.url,
|
|
506
|
+
// ],
|
|
507
|
+
// },
|
|
495
508
|
}
|
|
496
509
|
});
|
|
497
510
|
}
|
|
@@ -838,7 +851,9 @@ function getCompilerContext(opts) {
|
|
|
838
851
|
appType,
|
|
839
852
|
ignoreCallExpressionIdentifiers,
|
|
840
853
|
ignoreTaggedTemplateExpressionIdentifiers,
|
|
841
|
-
cssPresetEnv
|
|
854
|
+
cssPresetEnv,
|
|
855
|
+
tailwindcss,
|
|
856
|
+
resolve
|
|
842
857
|
} = ctx;
|
|
843
858
|
const customAttributesEntities = isMap(customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
|
|
844
859
|
const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
|
|
@@ -880,9 +895,13 @@ function getCompilerContext(opts) {
|
|
|
880
895
|
ctx.jsHandler = jsHandler2;
|
|
881
896
|
ctx.templateHandler = templateHandler;
|
|
882
897
|
const twPatcher = createTailwindcssPatcher(
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
898
|
+
{
|
|
899
|
+
basedir: tailwindcssBasedir,
|
|
900
|
+
cacheDir: appType === "mpx" ? "node_modules/tailwindcss-patch/.cache" : void 0,
|
|
901
|
+
supportCustomLengthUnitsPatch: supportCustomLengthUnitsPatch != null ? supportCustomLengthUnitsPatch : true,
|
|
902
|
+
tailwindcss,
|
|
903
|
+
resolve
|
|
904
|
+
}
|
|
886
905
|
);
|
|
887
906
|
ctx.setMangleRuntimeSet = setMangleRuntimeSet;
|
|
888
907
|
ctx.cache = initializeCache(cache);
|
|
@@ -6,7 +6,7 @@ var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
|
6
6
|
var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNSZPW6UUjs = require('./chunk-NSZPW6UU.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
@@ -17,7 +17,7 @@ var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
|
17
17
|
// src/bundlers/vite/index.ts
|
|
18
18
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
19
19
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
20
|
-
const opts =
|
|
20
|
+
const opts = _chunkNSZPW6UUjs.getCompilerContext.call(void 0, options);
|
|
21
21
|
const {
|
|
22
22
|
disabled,
|
|
23
23
|
onEnd,
|
|
@@ -47,7 +47,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
47
47
|
onStart();
|
|
48
48
|
const entries = Object.entries(bundle);
|
|
49
49
|
const groupedEntries = _chunk35CYTBPMjs.getGroupedEntries.call(void 0, entries, opts);
|
|
50
|
-
const runtimeSet = twPatcher.getClassSet();
|
|
50
|
+
const runtimeSet = yield twPatcher.getClassSet();
|
|
51
51
|
setMangleRuntimeSet(runtimeSet);
|
|
52
52
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
53
53
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNSZPW6UUjs = require('./chunk-NSZPW6UU.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
|
15
15
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
16
16
|
var Transform = _stream2.default.Transform;
|
|
17
17
|
function createPlugins(options = {}) {
|
|
18
|
-
const opts =
|
|
18
|
+
const opts = _chunkNSZPW6UUjs.getCompilerContext.call(void 0, options);
|
|
19
19
|
const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
|
|
20
20
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
21
21
|
twPatcher.patch();
|
|
@@ -24,7 +24,7 @@ function createPlugins(options = {}) {
|
|
|
24
24
|
objectMode: true,
|
|
25
25
|
transform(file, _encoding, callback) {
|
|
26
26
|
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
27
|
-
runtimeSet = twPatcher.getClassSet();
|
|
27
|
+
runtimeSet = yield twPatcher.getClassSet();
|
|
28
28
|
setMangleRuntimeSet(runtimeSet);
|
|
29
29
|
const error = null;
|
|
30
30
|
if (file.contents) {
|
|
@@ -472,8 +472,10 @@ var _localpkg = require('local-pkg');
|
|
|
472
472
|
// src/tailwindcss/patcher.ts
|
|
473
473
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
474
474
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
475
|
+
var _escape3 = require('@weapp-core/escape');
|
|
475
476
|
var _tailwindcsspatch = require('tailwindcss-patch');
|
|
476
|
-
function createTailwindcssPatcher(
|
|
477
|
+
function createTailwindcssPatcher(options) {
|
|
478
|
+
const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, resolve } = options || {};
|
|
477
479
|
const cache = {};
|
|
478
480
|
if (cacheDir) {
|
|
479
481
|
if (_path2.default.isAbsolute(cacheDir)) {
|
|
@@ -491,7 +493,18 @@ function createTailwindcssPatcher(basedir, cacheDir, supportCustomLengthUnitsPat
|
|
|
491
493
|
applyPatches: {
|
|
492
494
|
exportContext: true,
|
|
493
495
|
extendLengthUnits: supportCustomLengthUnitsPatch
|
|
496
|
+
},
|
|
497
|
+
tailwindcss,
|
|
498
|
+
resolve,
|
|
499
|
+
filter: (x) => {
|
|
500
|
+
return !_escape3.isAllowedClassName.call(void 0, x);
|
|
494
501
|
}
|
|
502
|
+
// for example
|
|
503
|
+
// resolve: {
|
|
504
|
+
// paths: [
|
|
505
|
+
// import.meta.url,
|
|
506
|
+
// ],
|
|
507
|
+
// },
|
|
495
508
|
}
|
|
496
509
|
});
|
|
497
510
|
}
|
|
@@ -838,7 +851,9 @@ function getCompilerContext(opts) {
|
|
|
838
851
|
appType,
|
|
839
852
|
ignoreCallExpressionIdentifiers,
|
|
840
853
|
ignoreTaggedTemplateExpressionIdentifiers,
|
|
841
|
-
cssPresetEnv
|
|
854
|
+
cssPresetEnv,
|
|
855
|
+
tailwindcss,
|
|
856
|
+
resolve
|
|
842
857
|
} = ctx;
|
|
843
858
|
const customAttributesEntities = _chunk35CYTBPMjs.isMap.call(void 0, customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
|
|
844
859
|
const { initMangle, mangleContext, setMangleRuntimeSet } = _mangle.useMangleStore.call(void 0, );
|
|
@@ -880,9 +895,13 @@ function getCompilerContext(opts) {
|
|
|
880
895
|
ctx.jsHandler = jsHandler2;
|
|
881
896
|
ctx.templateHandler = templateHandler;
|
|
882
897
|
const twPatcher = createTailwindcssPatcher(
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
898
|
+
{
|
|
899
|
+
basedir: tailwindcssBasedir,
|
|
900
|
+
cacheDir: appType === "mpx" ? "node_modules/tailwindcss-patch/.cache" : void 0,
|
|
901
|
+
supportCustomLengthUnitsPatch: supportCustomLengthUnitsPatch != null ? supportCustomLengthUnitsPatch : true,
|
|
902
|
+
tailwindcss,
|
|
903
|
+
resolve
|
|
904
|
+
}
|
|
886
905
|
);
|
|
887
906
|
ctx.setMangleRuntimeSet = setMangleRuntimeSet;
|
|
888
907
|
ctx.cache = initializeCache(cache);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-75EWCRQW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getCompilerContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FHP2IWTD.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
@@ -24,7 +24,7 @@ function createPlugins(options = {}) {
|
|
|
24
24
|
objectMode: true,
|
|
25
25
|
transform(file, _encoding, callback) {
|
|
26
26
|
return __async(this, null, function* () {
|
|
27
|
-
runtimeSet = twPatcher.getClassSet();
|
|
27
|
+
runtimeSet = yield twPatcher.getClassSet();
|
|
28
28
|
setMangleRuntimeSet(runtimeSet);
|
|
29
29
|
const error = null;
|
|
30
30
|
if (file.contents) {
|
|
@@ -6,7 +6,7 @@ var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
|
6
6
|
var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNSZPW6UUjs = require('./chunk-NSZPW6UU.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -21,7 +21,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
21
21
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
22
22
|
var UnifiedWebpackPluginV5 = class {
|
|
23
23
|
constructor(options = {}) {
|
|
24
|
-
this.options =
|
|
24
|
+
this.options = _chunkNSZPW6UUjs.getCompilerContext.call(void 0, options);
|
|
25
25
|
this.appType = this.options.appType;
|
|
26
26
|
}
|
|
27
27
|
apply(compiler) {
|
|
@@ -84,7 +84,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
84
84
|
}
|
|
85
85
|
const entries = Object.entries(assets);
|
|
86
86
|
const groupedEntries = _chunk35CYTBPMjs.getGroupedEntries.call(void 0, entries, this.options);
|
|
87
|
-
const runtimeSet = getClassSet();
|
|
87
|
+
const runtimeSet = yield getClassSet();
|
|
88
88
|
setMangleRuntimeSet(runtimeSet);
|
|
89
89
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
90
90
|
if (Array.isArray(groupedEntries.html)) {
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkNSZPW6UUjs = require('./chunk-NSZPW6UU.js');
|
|
8
8
|
require('./chunk-WGQLZ5K4.js');
|
|
9
9
|
require('./chunk-YUXG2EJF.js');
|
|
10
10
|
require('./chunk-35CYTBPM.js');
|
|
@@ -17,13 +17,13 @@ var _semver = require('semver'); var _semver2 = _interopRequireDefault(_semver);
|
|
|
17
17
|
_process2.default.title = "node (weapp-tailwindcss)";
|
|
18
18
|
var args = _process2.default.argv.slice(2);
|
|
19
19
|
if (_semver2.default.lt(_process2.default.versions.node, _chunkN62XM3T3js.WEAPP_TW_REQUIRED_NODE_VERSION)) {
|
|
20
|
-
|
|
20
|
+
_chunkNSZPW6UUjs.logger.warn(
|
|
21
21
|
`You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkN62XM3T3js.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
var command = args[0];
|
|
25
25
|
if (command === "patch") {
|
|
26
|
-
const ctx =
|
|
26
|
+
const ctx = _chunkNSZPW6UUjs.getCompilerContext.call(void 0, );
|
|
27
27
|
ctx.twPatcher.patch();
|
|
28
28
|
} else if (command === "init") {
|
|
29
29
|
_init.init.call(void 0, );
|
package/dist/cli.mjs
CHANGED
package/dist/core.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import 'tailwindcss-patch';
|
|
|
8
8
|
import 'node:buffer';
|
|
9
9
|
import 'webpack';
|
|
10
10
|
import 'lru-cache';
|
|
11
|
+
import 'local-pkg';
|
|
11
12
|
import 'postcss-preset-env';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -20,7 +21,7 @@ declare function createContext(options?: UserDefinedOptions): {
|
|
|
20
21
|
transformWxml: (rawWxml: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
21
22
|
transformJs: (rawJs: string, options?: {
|
|
22
23
|
runtimeSet?: Set<string>;
|
|
23
|
-
} & CreateJsHandlerOptions) =>
|
|
24
|
+
} & CreateJsHandlerOptions) => Promise<JsHandlerResult>;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export { createContext };
|
package/dist/core.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import 'tailwindcss-patch';
|
|
|
8
8
|
import 'node:buffer';
|
|
9
9
|
import 'webpack';
|
|
10
10
|
import 'lru-cache';
|
|
11
|
+
import 'local-pkg';
|
|
11
12
|
import 'postcss-preset-env';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -20,7 +21,7 @@ declare function createContext(options?: UserDefinedOptions): {
|
|
|
20
21
|
transformWxml: (rawWxml: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
21
22
|
transformJs: (rawJs: string, options?: {
|
|
22
23
|
runtimeSet?: Set<string>;
|
|
23
|
-
} & CreateJsHandlerOptions) =>
|
|
24
|
+
} & CreateJsHandlerOptions) => Promise<JsHandlerResult>;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
export { createContext };
|
package/dist/core.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNSZPW6UUjs = require('./chunk-NSZPW6UU.js');
|
|
4
4
|
require('./chunk-WGQLZ5K4.js');
|
|
5
5
|
require('./chunk-YUXG2EJF.js');
|
|
6
6
|
require('./chunk-35CYTBPM.js');
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
8
10
|
|
|
9
11
|
// src/core.ts
|
|
10
12
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
11
13
|
function createContext(options = {}) {
|
|
12
|
-
const opts =
|
|
14
|
+
const opts = _chunkNSZPW6UUjs.getCompilerContext.call(void 0, options);
|
|
13
15
|
const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
|
|
14
16
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
15
17
|
twPatcher.patch();
|
|
@@ -18,9 +20,11 @@ function createContext(options = {}) {
|
|
|
18
20
|
isMainChunk: true
|
|
19
21
|
}));
|
|
20
22
|
}
|
|
21
|
-
function transformJs(
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
function transformJs(_0) {
|
|
24
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, arguments, function* (rawJs, options2 = {}) {
|
|
25
|
+
runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : yield twPatcher.getClassSet();
|
|
26
|
+
return yield jsHandler(rawJs, runtimeSet, options2);
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
function transformWxml(rawWxml, options2) {
|
|
26
30
|
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
|
package/dist/core.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FHP2IWTD.mjs";
|
|
4
4
|
import "./chunk-PCBSAFQF.mjs";
|
|
5
5
|
import "./chunk-RHTRRSP3.mjs";
|
|
6
6
|
import "./chunk-MUJ65IQ3.mjs";
|
|
7
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
__async
|
|
9
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
8
10
|
|
|
9
11
|
// src/core.ts
|
|
10
12
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
@@ -18,9 +20,11 @@ function createContext(options = {}) {
|
|
|
18
20
|
isMainChunk: true
|
|
19
21
|
}));
|
|
20
22
|
}
|
|
21
|
-
function transformJs(
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
function transformJs(_0) {
|
|
24
|
+
return __async(this, arguments, function* (rawJs, options2 = {}) {
|
|
25
|
+
runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : yield twPatcher.getClassSet();
|
|
26
|
+
return yield jsHandler(rawJs, runtimeSet, options2);
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
function transformWxml(rawWxml, options2) {
|
|
26
30
|
return templateHandler(rawWxml, defuOverrideArray(options2, {
|
package/dist/defaults.d.mts
CHANGED
package/dist/defaults.d.ts
CHANGED
package/dist/escape.d.mts
CHANGED
package/dist/escape.d.ts
CHANGED
package/dist/gulp.d.mts
CHANGED
package/dist/gulp.d.ts
CHANGED
package/dist/gulp.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMGGYACFYjs = require('./chunk-MGGYACFY.js');
|
|
4
4
|
require('./chunk-HBQASQKY.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-NSZPW6UU.js');
|
|
6
6
|
require('./chunk-WGQLZ5K4.js');
|
|
7
7
|
require('./chunk-YUXG2EJF.js');
|
|
8
8
|
require('./chunk-35CYTBPM.js');
|
|
9
9
|
require('./chunk-6FNC3XMI.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createPlugins =
|
|
12
|
+
exports.createPlugins = _chunkMGGYACFYjs.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TFTD2FWQ.mjs";
|
|
4
4
|
import "./chunk-75EWCRQW.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-FHP2IWTD.mjs";
|
|
6
6
|
import "./chunk-PCBSAFQF.mjs";
|
|
7
7
|
import "./chunk-RHTRRSP3.mjs";
|
|
8
8
|
import "./chunk-MUJ65IQ3.mjs";
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-FXPGR372.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXKF5XSEOjs = require('./chunk-XKF5XSEO.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMGGYACFYjs = require('./chunk-MGGYACFY.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkG63AWKPGjs = require('./chunk-G63AWKPG.js');
|
|
11
11
|
require('./chunk-HBQASQKY.js');
|
|
12
12
|
require('./chunk-N62XM3T3.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-NSZPW6UU.js');
|
|
14
14
|
require('./chunk-WGQLZ5K4.js');
|
|
15
15
|
require('./chunk-YUXG2EJF.js');
|
|
16
16
|
require('./chunk-35CYTBPM.js');
|
|
@@ -19,4 +19,4 @@ require('./chunk-6FNC3XMI.js');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
22
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkG63AWKPGjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkXKF5XSEOjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkMGGYACFYjs.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./chunk-LOLJLZCX.mjs";
|
|
2
2
|
import {
|
|
3
3
|
UnifiedWebpackPluginV5
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3HOCRXDT.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createPlugins
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TFTD2FWQ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
UnifiedViteWeappTailwindcssPlugin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-D6FTUNLD.mjs";
|
|
11
11
|
import "./chunk-75EWCRQW.mjs";
|
|
12
12
|
import "./chunk-HL6Y5PYZ.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FHP2IWTD.mjs";
|
|
14
14
|
import "./chunk-PCBSAFQF.mjs";
|
|
15
15
|
import "./chunk-RHTRRSP3.mjs";
|
|
16
16
|
import "./chunk-MUJ65IQ3.mjs";
|
package/dist/types.d.mts
CHANGED
|
@@ -5,10 +5,11 @@ import { CssPreflightOptions, LoadedPostcssOptions, CustomRuleCallback, IStyleHa
|
|
|
5
5
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
6
6
|
import { SourceMap } from 'magic-string';
|
|
7
7
|
import { Result, Root, Document } from 'postcss';
|
|
8
|
-
import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
8
|
+
import { PatchOptions, ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
9
9
|
import { Buffer } from 'node:buffer';
|
|
10
10
|
import { sources } from 'webpack';
|
|
11
11
|
import { LRUCache } from 'lru-cache';
|
|
12
|
+
import { PackageResolvingOptions } from 'local-pkg';
|
|
12
13
|
import { pluginOptions } from 'postcss-preset-env';
|
|
13
14
|
|
|
14
15
|
interface HashMapValue {
|
|
@@ -41,6 +42,22 @@ interface UserDefinedOptions {
|
|
|
41
42
|
/**
|
|
42
43
|
* @group 0.重要配置
|
|
43
44
|
* @description 是否禁用此插件,一般用于构建到多平台时使用,比如小程序时不传,非小程序环境(h5,app)传入一个 `true`
|
|
45
|
+
* ```ts
|
|
46
|
+
* // 比如 uni-app vue3 vite
|
|
47
|
+
* import process from 'node:process'
|
|
48
|
+
|
|
49
|
+
const isH5 = process.env.UNI_PLATFORM === 'h5'
|
|
50
|
+
const isApp = process.env.UNI_PLATFORM === 'app'
|
|
51
|
+
const WeappTailwindcssDisabled = isH5 || isApp
|
|
52
|
+
|
|
53
|
+
import { UnifiedViteWeappTailwindcssPlugin as uvtw } from 'weapp-tailwindcss/vite'
|
|
54
|
+
// 注册插件
|
|
55
|
+
// highlight-start
|
|
56
|
+
uvtw({
|
|
57
|
+
disabled: WeappTailwindcssDisabled,
|
|
58
|
+
}),
|
|
59
|
+
// highlight-end
|
|
60
|
+
* ```
|
|
44
61
|
*/
|
|
45
62
|
disabled?: boolean;
|
|
46
63
|
/**
|
|
@@ -82,12 +99,6 @@ interface UserDefinedOptions {
|
|
|
82
99
|
* @default MappingChars2String
|
|
83
100
|
*/
|
|
84
101
|
customReplaceDictionary?: Record<string, string>;
|
|
85
|
-
/**
|
|
86
|
-
* @version `^3.1.0`
|
|
87
|
-
* @group 0.重要配置
|
|
88
|
-
* @description 对解析 js 使用的 ast 工具,默认情况使用 `babel`,可以通过安装 `@ast-grep/napi`,同时启用 `ast-grep` 配置项,来启用 `ast-grep` 来处理 `js`,速度会是 `babel` 的 `2` 倍左右
|
|
89
|
-
*/
|
|
90
|
-
jsAstTool?: 'babel' | 'ast-grep';
|
|
91
102
|
/**
|
|
92
103
|
* @version `^4.0.0`
|
|
93
104
|
* @group 0.重要配置
|
|
@@ -187,6 +198,14 @@ interface UserDefinedOptions {
|
|
|
187
198
|
* @version `^3.0.0`
|
|
188
199
|
* @group 0.重要配置
|
|
189
200
|
* @description rem 转 rpx 配置,默认为 `undefined` 不开启,可传入 `true` 启用默认配置项,也可传入自定义配置项,配置项列表见 [postcss-rem-to-responsive-pixel](https://www.npmjs.com/package/postcss-rem-to-responsive-pixel)
|
|
201
|
+
* ```ts
|
|
202
|
+
* // 默认值
|
|
203
|
+
* {
|
|
204
|
+
* rootValue: 32,
|
|
205
|
+
* propList: ['*'],
|
|
206
|
+
* transformUnit: 'rpx',
|
|
207
|
+
* }
|
|
208
|
+
* ```
|
|
190
209
|
*/
|
|
191
210
|
rem2rpx?: boolean | UserDefinedOptions;
|
|
192
211
|
/**
|
|
@@ -195,6 +214,12 @@ interface UserDefinedOptions {
|
|
|
195
214
|
* @description postcss-preset-env 的入参数
|
|
196
215
|
*/
|
|
197
216
|
cssPresetEnv?: pluginOptions;
|
|
217
|
+
/**
|
|
218
|
+
* @version `^4.0.0`
|
|
219
|
+
* @group 0.重要配置
|
|
220
|
+
* @description 配置不同版本 tailwindcss 的行为
|
|
221
|
+
*/
|
|
222
|
+
tailwindcss?: PatchOptions['tailwindcss'];
|
|
198
223
|
}
|
|
199
224
|
interface UserDefinedOptions {
|
|
200
225
|
/**
|
|
@@ -295,12 +320,6 @@ interface UserDefinedOptions {
|
|
|
295
320
|
* @description 使用的框架类型(uni-app,taro...),用于找到主要的 `css bundle` 进行转化,这个配置会影响默认方法 `mainCssChunkMatcher` 的行为,不传会去猜测 `tailwindcss css var inject scope` (tailwindcss 变量注入的位置) 的位置
|
|
296
321
|
*/
|
|
297
322
|
appType?: AppType;
|
|
298
|
-
/**
|
|
299
|
-
* @group 3.一般配置
|
|
300
|
-
* @description 是否压缩混淆 `wxml`,`js` 和 `wxss` 中指定范围的 `class` 以避免选择器过长问题,默认为`false`不开启,详细配置见 [unplugin-tailwindcss-mangle](https://github.com/sonofmagic/tailwindcss-mangle/tree/main/packages/unplugin-tailwindcss-mangle)
|
|
301
|
-
* @url https://github.com/sonofmagic/tailwindcss-mangle
|
|
302
|
-
*/
|
|
303
|
-
mangle?: boolean | IMangleOptions;
|
|
304
323
|
/**
|
|
305
324
|
* @group 3.一般配置
|
|
306
325
|
* @description 针对 tailwindcss arbitrary values 的一些配置
|
|
@@ -393,6 +412,37 @@ interface UserDefinedOptions {
|
|
|
393
412
|
* @description 用于自定义处理 css 的回调函数,可根据 Postcss walk 方法自由定制处理方案的 callback 方法
|
|
394
413
|
*/
|
|
395
414
|
customRuleCallback?: CustomRuleCallback;
|
|
415
|
+
/**
|
|
416
|
+
* @group 3.一般配置
|
|
417
|
+
* @description 用于自定义 tailwindcss 包的寻找方法
|
|
418
|
+
*/
|
|
419
|
+
resolve?: PackageResolvingOptions;
|
|
420
|
+
}
|
|
421
|
+
interface UserDefinedOptions {
|
|
422
|
+
/**
|
|
423
|
+
* @group 4.即将废弃配置
|
|
424
|
+
* @description 对解析 js 使用的 ast 工具,默认情况使用 `babel`,可以通过安装 `@ast-grep/napi`,同时启用 `ast-grep` 配置项,来启用 `ast-grep` 来处理 `js`,速度会是 `babel` 的 `2` 倍左右
|
|
425
|
+
* :::danger
|
|
426
|
+
* 此配置即将在 `5.x` 被弃用
|
|
427
|
+
*
|
|
428
|
+
* 废弃原因:
|
|
429
|
+
*
|
|
430
|
+
* 虽然 `@ast-grep/napi` 提供了更快的速度,但是 `babel` 有更强的静态分析 `js` 能力,使得后续一些新功能的开发无法使用 `@ast-grep/napi` 实现,所以废弃只保留 `babel` 的方式
|
|
431
|
+
* :::
|
|
432
|
+
*/
|
|
433
|
+
jsAstTool?: 'babel' | 'ast-grep';
|
|
434
|
+
/**
|
|
435
|
+
* @group 4.即将废弃配置
|
|
436
|
+
* @description 是否压缩混淆 `wxml`,`js` 和 `wxss` 中指定范围的 `class` 以避免选择器过长问题,默认为`false`不开启,详细配置见 [unplugin-tailwindcss-mangle](https://github.com/sonofmagic/tailwindcss-mangle/tree/main/packages/unplugin-tailwindcss-mangle)
|
|
437
|
+
* :::danger
|
|
438
|
+
* 此配置即将在 `5.x` 被弃用
|
|
439
|
+
*
|
|
440
|
+
* 废弃原因:
|
|
441
|
+
*
|
|
442
|
+
* mangle 相关的功能会被迁移到另外一个项目: [`tailwindcss-mangle`](https://github.com/sonofmagic/tailwindcss-mangle) 中去,还想要这个功能可以2个插件结合使用
|
|
443
|
+
* :::
|
|
444
|
+
*/
|
|
445
|
+
mangle?: boolean | IMangleOptions;
|
|
396
446
|
}
|
|
397
447
|
|
|
398
448
|
type ItemOrItemArray<T> = T | T[];
|
package/dist/types.d.ts
CHANGED
|
@@ -5,10 +5,11 @@ import { CssPreflightOptions, LoadedPostcssOptions, CustomRuleCallback, IStyleHa
|
|
|
5
5
|
export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
|
|
6
6
|
import { SourceMap } from 'magic-string';
|
|
7
7
|
import { Result, Root, Document } from 'postcss';
|
|
8
|
-
import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
8
|
+
import { PatchOptions, ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
9
9
|
import { Buffer } from 'node:buffer';
|
|
10
10
|
import { sources } from 'webpack';
|
|
11
11
|
import { LRUCache } from 'lru-cache';
|
|
12
|
+
import { PackageResolvingOptions } from 'local-pkg';
|
|
12
13
|
import { pluginOptions } from 'postcss-preset-env';
|
|
13
14
|
|
|
14
15
|
interface HashMapValue {
|
|
@@ -41,6 +42,22 @@ interface UserDefinedOptions {
|
|
|
41
42
|
/**
|
|
42
43
|
* @group 0.重要配置
|
|
43
44
|
* @description 是否禁用此插件,一般用于构建到多平台时使用,比如小程序时不传,非小程序环境(h5,app)传入一个 `true`
|
|
45
|
+
* ```ts
|
|
46
|
+
* // 比如 uni-app vue3 vite
|
|
47
|
+
* import process from 'node:process'
|
|
48
|
+
|
|
49
|
+
const isH5 = process.env.UNI_PLATFORM === 'h5'
|
|
50
|
+
const isApp = process.env.UNI_PLATFORM === 'app'
|
|
51
|
+
const WeappTailwindcssDisabled = isH5 || isApp
|
|
52
|
+
|
|
53
|
+
import { UnifiedViteWeappTailwindcssPlugin as uvtw } from 'weapp-tailwindcss/vite'
|
|
54
|
+
// 注册插件
|
|
55
|
+
// highlight-start
|
|
56
|
+
uvtw({
|
|
57
|
+
disabled: WeappTailwindcssDisabled,
|
|
58
|
+
}),
|
|
59
|
+
// highlight-end
|
|
60
|
+
* ```
|
|
44
61
|
*/
|
|
45
62
|
disabled?: boolean;
|
|
46
63
|
/**
|
|
@@ -82,12 +99,6 @@ interface UserDefinedOptions {
|
|
|
82
99
|
* @default MappingChars2String
|
|
83
100
|
*/
|
|
84
101
|
customReplaceDictionary?: Record<string, string>;
|
|
85
|
-
/**
|
|
86
|
-
* @version `^3.1.0`
|
|
87
|
-
* @group 0.重要配置
|
|
88
|
-
* @description 对解析 js 使用的 ast 工具,默认情况使用 `babel`,可以通过安装 `@ast-grep/napi`,同时启用 `ast-grep` 配置项,来启用 `ast-grep` 来处理 `js`,速度会是 `babel` 的 `2` 倍左右
|
|
89
|
-
*/
|
|
90
|
-
jsAstTool?: 'babel' | 'ast-grep';
|
|
91
102
|
/**
|
|
92
103
|
* @version `^4.0.0`
|
|
93
104
|
* @group 0.重要配置
|
|
@@ -187,6 +198,14 @@ interface UserDefinedOptions {
|
|
|
187
198
|
* @version `^3.0.0`
|
|
188
199
|
* @group 0.重要配置
|
|
189
200
|
* @description rem 转 rpx 配置,默认为 `undefined` 不开启,可传入 `true` 启用默认配置项,也可传入自定义配置项,配置项列表见 [postcss-rem-to-responsive-pixel](https://www.npmjs.com/package/postcss-rem-to-responsive-pixel)
|
|
201
|
+
* ```ts
|
|
202
|
+
* // 默认值
|
|
203
|
+
* {
|
|
204
|
+
* rootValue: 32,
|
|
205
|
+
* propList: ['*'],
|
|
206
|
+
* transformUnit: 'rpx',
|
|
207
|
+
* }
|
|
208
|
+
* ```
|
|
190
209
|
*/
|
|
191
210
|
rem2rpx?: boolean | UserDefinedOptions;
|
|
192
211
|
/**
|
|
@@ -195,6 +214,12 @@ interface UserDefinedOptions {
|
|
|
195
214
|
* @description postcss-preset-env 的入参数
|
|
196
215
|
*/
|
|
197
216
|
cssPresetEnv?: pluginOptions;
|
|
217
|
+
/**
|
|
218
|
+
* @version `^4.0.0`
|
|
219
|
+
* @group 0.重要配置
|
|
220
|
+
* @description 配置不同版本 tailwindcss 的行为
|
|
221
|
+
*/
|
|
222
|
+
tailwindcss?: PatchOptions['tailwindcss'];
|
|
198
223
|
}
|
|
199
224
|
interface UserDefinedOptions {
|
|
200
225
|
/**
|
|
@@ -295,12 +320,6 @@ interface UserDefinedOptions {
|
|
|
295
320
|
* @description 使用的框架类型(uni-app,taro...),用于找到主要的 `css bundle` 进行转化,这个配置会影响默认方法 `mainCssChunkMatcher` 的行为,不传会去猜测 `tailwindcss css var inject scope` (tailwindcss 变量注入的位置) 的位置
|
|
296
321
|
*/
|
|
297
322
|
appType?: AppType;
|
|
298
|
-
/**
|
|
299
|
-
* @group 3.一般配置
|
|
300
|
-
* @description 是否压缩混淆 `wxml`,`js` 和 `wxss` 中指定范围的 `class` 以避免选择器过长问题,默认为`false`不开启,详细配置见 [unplugin-tailwindcss-mangle](https://github.com/sonofmagic/tailwindcss-mangle/tree/main/packages/unplugin-tailwindcss-mangle)
|
|
301
|
-
* @url https://github.com/sonofmagic/tailwindcss-mangle
|
|
302
|
-
*/
|
|
303
|
-
mangle?: boolean | IMangleOptions;
|
|
304
323
|
/**
|
|
305
324
|
* @group 3.一般配置
|
|
306
325
|
* @description 针对 tailwindcss arbitrary values 的一些配置
|
|
@@ -393,6 +412,37 @@ interface UserDefinedOptions {
|
|
|
393
412
|
* @description 用于自定义处理 css 的回调函数,可根据 Postcss walk 方法自由定制处理方案的 callback 方法
|
|
394
413
|
*/
|
|
395
414
|
customRuleCallback?: CustomRuleCallback;
|
|
415
|
+
/**
|
|
416
|
+
* @group 3.一般配置
|
|
417
|
+
* @description 用于自定义 tailwindcss 包的寻找方法
|
|
418
|
+
*/
|
|
419
|
+
resolve?: PackageResolvingOptions;
|
|
420
|
+
}
|
|
421
|
+
interface UserDefinedOptions {
|
|
422
|
+
/**
|
|
423
|
+
* @group 4.即将废弃配置
|
|
424
|
+
* @description 对解析 js 使用的 ast 工具,默认情况使用 `babel`,可以通过安装 `@ast-grep/napi`,同时启用 `ast-grep` 配置项,来启用 `ast-grep` 来处理 `js`,速度会是 `babel` 的 `2` 倍左右
|
|
425
|
+
* :::danger
|
|
426
|
+
* 此配置即将在 `5.x` 被弃用
|
|
427
|
+
*
|
|
428
|
+
* 废弃原因:
|
|
429
|
+
*
|
|
430
|
+
* 虽然 `@ast-grep/napi` 提供了更快的速度,但是 `babel` 有更强的静态分析 `js` 能力,使得后续一些新功能的开发无法使用 `@ast-grep/napi` 实现,所以废弃只保留 `babel` 的方式
|
|
431
|
+
* :::
|
|
432
|
+
*/
|
|
433
|
+
jsAstTool?: 'babel' | 'ast-grep';
|
|
434
|
+
/**
|
|
435
|
+
* @group 4.即将废弃配置
|
|
436
|
+
* @description 是否压缩混淆 `wxml`,`js` 和 `wxss` 中指定范围的 `class` 以避免选择器过长问题,默认为`false`不开启,详细配置见 [unplugin-tailwindcss-mangle](https://github.com/sonofmagic/tailwindcss-mangle/tree/main/packages/unplugin-tailwindcss-mangle)
|
|
437
|
+
* :::danger
|
|
438
|
+
* 此配置即将在 `5.x` 被弃用
|
|
439
|
+
*
|
|
440
|
+
* 废弃原因:
|
|
441
|
+
*
|
|
442
|
+
* mangle 相关的功能会被迁移到另外一个项目: [`tailwindcss-mangle`](https://github.com/sonofmagic/tailwindcss-mangle) 中去,还想要这个功能可以2个插件结合使用
|
|
443
|
+
* :::
|
|
444
|
+
*/
|
|
445
|
+
mangle?: boolean | IMangleOptions;
|
|
396
446
|
}
|
|
397
447
|
|
|
398
448
|
type ItemOrItemArray<T> = T | T[];
|
package/dist/vite.d.mts
CHANGED
package/dist/vite.d.ts
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkG63AWKPGjs = require('./chunk-G63AWKPG.js');
|
|
4
4
|
require('./chunk-HBQASQKY.js');
|
|
5
5
|
require('./chunk-N62XM3T3.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-NSZPW6UU.js');
|
|
7
7
|
require('./chunk-WGQLZ5K4.js');
|
|
8
8
|
require('./chunk-YUXG2EJF.js');
|
|
9
9
|
require('./chunk-35CYTBPM.js');
|
|
10
10
|
require('./chunk-6FNC3XMI.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
13
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkG63AWKPGjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D6FTUNLD.mjs";
|
|
4
4
|
import "./chunk-75EWCRQW.mjs";
|
|
5
5
|
import "./chunk-HL6Y5PYZ.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FHP2IWTD.mjs";
|
|
7
7
|
import "./chunk-PCBSAFQF.mjs";
|
|
8
8
|
import "./chunk-RHTRRSP3.mjs";
|
|
9
9
|
import "./chunk-MUJ65IQ3.mjs";
|
package/dist/webpack.d.mts
CHANGED
package/dist/webpack.d.ts
CHANGED
package/dist/webpack.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXKF5XSEOjs = require('./chunk-XKF5XSEO.js');
|
|
4
4
|
require('./chunk-HBQASQKY.js');
|
|
5
5
|
require('./chunk-N62XM3T3.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-NSZPW6UU.js');
|
|
7
7
|
require('./chunk-WGQLZ5K4.js');
|
|
8
8
|
require('./chunk-YUXG2EJF.js');
|
|
9
9
|
require('./chunk-35CYTBPM.js');
|
|
10
10
|
require('./chunk-6FNC3XMI.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.UnifiedWebpackPluginV5 =
|
|
13
|
+
exports.UnifiedWebpackPluginV5 = _chunkXKF5XSEOjs.UnifiedWebpackPluginV5;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3HOCRXDT.mjs";
|
|
4
4
|
import "./chunk-75EWCRQW.mjs";
|
|
5
5
|
import "./chunk-HL6Y5PYZ.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FHP2IWTD.mjs";
|
|
7
7
|
import "./chunk-PCBSAFQF.mjs";
|
|
8
8
|
import "./chunk-RHTRRSP3.mjs";
|
|
9
9
|
import "./chunk-MUJ65IQ3.mjs";
|
package/dist/webpack4.d.mts
CHANGED
package/dist/webpack4.d.ts
CHANGED
package/dist/webpack4.js
CHANGED
|
@@ -6,7 +6,7 @@ var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
|
6
6
|
var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNSZPW6UUjs = require('./chunk-NSZPW6UU.js');
|
|
10
10
|
require('./chunk-WGQLZ5K4.js');
|
|
11
11
|
require('./chunk-YUXG2EJF.js');
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ var _webpacksources = require('webpack-sources');
|
|
|
24
24
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
25
25
|
var UnifiedWebpackPluginV4 = class {
|
|
26
26
|
constructor(options = {}) {
|
|
27
|
-
this.options =
|
|
27
|
+
this.options = _chunkNSZPW6UUjs.getCompilerContext.call(void 0, options);
|
|
28
28
|
this.appType = this.options.appType;
|
|
29
29
|
}
|
|
30
30
|
apply(compiler) {
|
|
@@ -82,7 +82,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
82
82
|
const assets = compilation.assets;
|
|
83
83
|
const entries = Object.entries(assets);
|
|
84
84
|
const groupedEntries = _chunk35CYTBPMjs.getGroupedEntries.call(void 0, entries, this.options);
|
|
85
|
-
const runtimeSet = getClassSet();
|
|
85
|
+
const runtimeSet = yield getClassSet();
|
|
86
86
|
setMangleRuntimeSet(runtimeSet);
|
|
87
87
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
88
88
|
if (Array.isArray(groupedEntries.html)) {
|
package/dist/webpack4.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-HL6Y5PYZ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
getCompilerContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FHP2IWTD.mjs";
|
|
10
10
|
import "./chunk-PCBSAFQF.mjs";
|
|
11
11
|
import "./chunk-RHTRRSP3.mjs";
|
|
12
12
|
import {
|
|
@@ -82,7 +82,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
82
82
|
const assets = compilation.assets;
|
|
83
83
|
const entries = Object.entries(assets);
|
|
84
84
|
const groupedEntries = getGroupedEntries(entries, this.options);
|
|
85
|
-
const runtimeSet = getClassSet();
|
|
85
|
+
const runtimeSet = yield getClassSet();
|
|
86
86
|
setMangleRuntimeSet(runtimeSet);
|
|
87
87
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
88
88
|
if (Array.isArray(groupedEntries.html)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -141,10 +141,10 @@
|
|
|
141
141
|
},
|
|
142
142
|
"dependencies": {
|
|
143
143
|
"@ast-core/escape": "~1.0.1",
|
|
144
|
-
"@babel/parser": "~7.26.
|
|
145
|
-
"@babel/traverse": "~7.26.
|
|
146
|
-
"@babel/types": "~7.26.
|
|
147
|
-
"@weapp-core/escape": "~4.0.
|
|
144
|
+
"@babel/parser": "~7.26.9",
|
|
145
|
+
"@babel/traverse": "~7.26.9",
|
|
146
|
+
"@babel/types": "~7.26.9",
|
|
147
|
+
"@weapp-core/escape": "~4.0.1",
|
|
148
148
|
"@weapp-core/regex": "~1.0.1",
|
|
149
149
|
"debug": "~4.4.0",
|
|
150
150
|
"htmlparser2": "10.0.0",
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
"magic-string": "0.30.17",
|
|
155
155
|
"md5": "2.3.0",
|
|
156
156
|
"semver": "~7.7.1",
|
|
157
|
-
"tailwindcss-patch": "~
|
|
157
|
+
"tailwindcss-patch": "~6.0.5",
|
|
158
158
|
"webpack-sources": "3.2.3",
|
|
159
|
-
"@weapp-tailwindcss/init": "1.0.0",
|
|
160
159
|
"@weapp-tailwindcss/logger": "1.0.0",
|
|
161
160
|
"@weapp-tailwindcss/mangle": "1.0.0",
|
|
162
|
-
"@weapp-tailwindcss/
|
|
161
|
+
"@weapp-tailwindcss/init": "1.0.0",
|
|
162
|
+
"@weapp-tailwindcss/postcss": "1.0.2",
|
|
163
163
|
"@weapp-tailwindcss/shared": "1.0.0"
|
|
164
164
|
},
|
|
165
165
|
"scripts": {
|