weapp-tailwindcss 4.11.0-alpha.1 → 4.11.0-alpha.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-35EI5JMK.mjs → chunk-23K4XDKF.mjs} +3 -1
- package/dist/{chunk-W2EMGF7H.js → chunk-2W24MRCQ.js} +10 -12
- package/dist/chunk-4AFQP74Z.js +24 -0
- package/dist/{chunk-SQG2MOFQ.js → chunk-4TTPYMVM.js} +12 -8
- package/dist/{chunk-4LPOQMFS.js → chunk-5KSBT6GU.js} +396 -219
- package/dist/{chunk-LD7LZ4IK.mjs → chunk-66E76FQE.mjs} +91 -50
- package/dist/{chunk-GWDHNCL2.js → chunk-6O7HJU2F.js} +123 -42
- package/dist/{chunk-RRHPTTCP.mjs → chunk-76S2EME4.mjs} +2 -0
- package/dist/{chunk-G3G437UE.js → chunk-7LKMJZD2.js} +2 -2
- package/dist/{chunk-OV7FX6XR.js → chunk-CRDOWYG4.js} +1 -1
- package/dist/{chunk-DOH7FULQ.mjs → chunk-EFBQ4SQR.mjs} +1 -1
- package/dist/{chunk-IEZ5RBMG.mjs → chunk-EW2K6CO5.mjs} +365 -188
- package/dist/{chunk-FZNYV7VH.mjs → chunk-HADJCWHU.mjs} +212 -258
- package/dist/{chunk-CZLXTEHN.js → chunk-K7CZXT46.js} +132 -91
- package/dist/{chunk-ACTJYB33.js → chunk-LL3QUKJI.js} +3 -1
- package/dist/{chunk-G5NLM3AL.js → chunk-LYGLQCWI.js} +278 -324
- package/dist/{chunk-LTJQUORK.js → chunk-OF6MFURR.js} +2 -0
- package/dist/{chunk-KKT2DKMW.mjs → chunk-RED7Y22U.mjs} +91 -10
- package/dist/{chunk-R6KEYO3F.mjs → chunk-SJ3SG6DU.mjs} +5 -1
- package/dist/{chunk-JBM3HGHP.mjs → chunk-UCUAXK7F.mjs} +4 -6
- package/dist/cli.js +1006 -147
- package/dist/cli.mjs +942 -107
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +9 -11
- package/dist/core.mjs +6 -8
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +3 -3
- package/dist/css-macro.mjs +4 -4
- package/dist/defaults.d.mts +2 -2
- package/dist/defaults.d.ts +2 -2
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.d.mts +2 -2
- package/dist/gulp.d.ts +2 -2
- package/dist/gulp.js +7 -8
- package/dist/gulp.mjs +6 -7
- package/dist/{index-t_VBjwYm.d.ts → index-BMwzhITq.d.mts} +6 -6
- package/dist/{index-t_VBjwYm.d.mts → index-BMwzhITq.d.ts} +6 -6
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -12
- package/dist/index.mjs +9 -10
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +2 -2
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.d.mts +4 -4
- package/dist/types.d.ts +4 -4
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +8 -9
- package/dist/vite.mjs +6 -7
- package/dist/weapp-tw-css-import-rewrite-loader.js +3 -1
- package/dist/weapp-tw-runtime-classset-loader.js +29 -2
- package/dist/webpack.d.mts +2 -2
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +9 -10
- package/dist/webpack.mjs +7 -8
- package/dist/webpack4.d.mts +2 -2
- package/dist/webpack4.d.ts +2 -2
- package/dist/webpack4.js +41 -41
- package/dist/webpack4.mjs +12 -12
- package/package.json +8 -8
- package/dist/chunk-NOKJXG3W.js +0 -29
- package/dist/chunk-QYZCRG7F.mjs +0 -29
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { U as UserDefinedOptions } from './index-
|
|
2
|
+
import { U as UserDefinedOptions } from './index-BMwzhITq.js';
|
|
3
3
|
import '@babel/parser';
|
|
4
|
-
import '@weapp-tailwindcss/postcss';
|
|
4
|
+
import '@weapp-tailwindcss/postcss/types';
|
|
5
5
|
import 'tailwindcss-patch';
|
|
6
6
|
import 'node:buffer';
|
|
7
7
|
import 'webpack';
|
package/dist/vite.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-ACTJYB33.js');
|
|
3
|
+
var _chunkK7CZXT46js = require('./chunk-K7CZXT46.js');
|
|
4
|
+
require('./chunk-7LKMJZD2.js');
|
|
5
|
+
require('./chunk-OF6MFURR.js');
|
|
6
|
+
require('./chunk-LYGLQCWI.js');
|
|
7
|
+
require('./chunk-5KSBT6GU.js');
|
|
8
|
+
require('./chunk-LL3QUKJI.js');
|
|
10
9
|
require('./chunk-DYLQ6UOI.js');
|
|
11
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-CRDOWYG4.js');
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
|
|
15
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkK7CZXT46js.UnifiedViteWeappTailwindcssPlugin; exports.weappTailwindcss = _chunkK7CZXT46js.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-66E76FQE.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-35EI5JMK.mjs";
|
|
5
|
+
import "./chunk-76S2EME4.mjs";
|
|
6
|
+
import "./chunk-HADJCWHU.mjs";
|
|
7
|
+
import "./chunk-EW2K6CO5.mjs";
|
|
8
|
+
import "./chunk-23K4XDKF.mjs";
|
|
10
9
|
import "./chunk-OOHJLO5M.mjs";
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-EFBQ4SQR.mjs";
|
|
12
11
|
export {
|
|
13
12
|
UnifiedViteWeappTailwindcssPlugin,
|
|
14
13
|
UnifiedViteWeappTailwindcssPlugin as weappTailwindcss
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-4AFQP74Z.js');
|
|
2
|
+
|
|
3
|
+
// src/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.ts
|
|
2
4
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
3
5
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
4
6
|
var _loaderutils = require('loader-utils'); var _loaderutils2 = _interopRequireDefault(_loaderutils);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
|
|
3
|
+
var _chunk4AFQP74Zjs = require('./chunk-4AFQP74Z.js');
|
|
4
|
+
|
|
5
|
+
// src/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.ts
|
|
2
6
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
3
7
|
var _loaderutils = require('loader-utils'); var _loaderutils2 = _interopRequireDefault(_loaderutils);
|
|
4
8
|
var WeappTwRuntimeClassSetLoader = function(source) {
|
|
@@ -8,9 +12,32 @@ var WeappTwRuntimeClassSetLoader = function(source) {
|
|
|
8
12
|
}
|
|
9
13
|
const opt = _loaderutils2.default.getOptions(this);
|
|
10
14
|
const maybePromise = (_a = opt == null ? void 0 : opt.getClassSet) == null ? void 0 : _a.call(opt);
|
|
15
|
+
const applyWatchDependencies = (dependencies) => {
|
|
16
|
+
var _a2, _b, _c, _d;
|
|
17
|
+
for (const file of (_a2 = dependencies == null ? void 0 : dependencies.files) != null ? _a2 : []) {
|
|
18
|
+
(_b = this.addDependency) == null ? void 0 : _b.call(this, file);
|
|
19
|
+
}
|
|
20
|
+
for (const context of (_c = dependencies == null ? void 0 : dependencies.contexts) != null ? _c : []) {
|
|
21
|
+
(_d = this.addContextDependency) == null ? void 0 : _d.call(this, context);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const resolveWatchDependencies = () => {
|
|
25
|
+
var _a2;
|
|
26
|
+
const dependencies = (_a2 = opt == null ? void 0 : opt.getWatchDependencies) == null ? void 0 : _a2.call(opt);
|
|
27
|
+
if (dependencies && typeof dependencies.then === "function") {
|
|
28
|
+
return Promise.resolve(dependencies).then((value) => {
|
|
29
|
+
applyWatchDependencies(value);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
applyWatchDependencies(dependencies);
|
|
33
|
+
};
|
|
11
34
|
if (maybePromise && typeof maybePromise.then === "function") {
|
|
12
|
-
return Promise.resolve(maybePromise).then(() =>
|
|
35
|
+
return Promise.resolve(maybePromise).then(() => _chunk4AFQP74Zjs.__async.call(void 0, this, null, function* () {
|
|
36
|
+
yield resolveWatchDependencies();
|
|
37
|
+
return source;
|
|
38
|
+
}));
|
|
13
39
|
}
|
|
40
|
+
resolveWatchDependencies();
|
|
14
41
|
return source;
|
|
15
42
|
};
|
|
16
43
|
var weapp_tw_runtime_classset_loader_default = WeappTwRuntimeClassSetLoader;
|
package/dist/webpack.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Compiler } from 'webpack';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.mjs';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-BMwzhITq.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/postcss';
|
|
5
|
+
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
|
7
7
|
import 'postcss';
|
|
8
8
|
import 'tailwindcss-patch';
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Compiler } from 'webpack';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-BMwzhITq.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/postcss';
|
|
5
|
+
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
|
7
7
|
import 'postcss';
|
|
8
8
|
import 'tailwindcss-patch';
|
package/dist/webpack.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-ACTJYB33.js');
|
|
4
|
+
var _chunk6O7HJU2Fjs = require('./chunk-6O7HJU2F.js');
|
|
5
|
+
require('./chunk-4TTPYMVM.js');
|
|
6
|
+
require('./chunk-7LKMJZD2.js');
|
|
7
|
+
require('./chunk-OF6MFURR.js');
|
|
8
|
+
require('./chunk-LYGLQCWI.js');
|
|
9
|
+
require('./chunk-5KSBT6GU.js');
|
|
10
|
+
require('./chunk-LL3QUKJI.js');
|
|
12
11
|
require('./chunk-DYLQ6UOI.js');
|
|
13
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-CRDOWYG4.js');
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunk6O7HJU2Fjs.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunk6O7HJU2Fjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunk6O7HJU2Fjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-RED7Y22U.mjs";
|
|
5
|
+
import "./chunk-SJ3SG6DU.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-35EI5JMK.mjs";
|
|
7
|
+
import "./chunk-76S2EME4.mjs";
|
|
8
|
+
import "./chunk-HADJCWHU.mjs";
|
|
9
|
+
import "./chunk-EW2K6CO5.mjs";
|
|
10
|
+
import "./chunk-23K4XDKF.mjs";
|
|
12
11
|
import "./chunk-OOHJLO5M.mjs";
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-EFBQ4SQR.mjs";
|
|
14
13
|
export {
|
|
15
14
|
UnifiedWebpackPluginV5,
|
|
16
15
|
UnifiedWebpackPluginV5 as weappTailwindcss,
|
package/dist/webpack4.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Compiler } from 'webpack4';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.mjs';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-BMwzhITq.mjs';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/postcss';
|
|
5
|
+
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
|
7
7
|
import 'postcss';
|
|
8
8
|
import 'tailwindcss-patch';
|
package/dist/webpack4.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Compiler } from 'webpack4';
|
|
2
2
|
import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
|
|
3
|
-
import { A as AppType, U as UserDefinedOptions } from './index-
|
|
3
|
+
import { A as AppType, U as UserDefinedOptions } from './index-BMwzhITq.js';
|
|
4
4
|
import '@babel/parser';
|
|
5
|
-
import '@weapp-tailwindcss/postcss';
|
|
5
|
+
import '@weapp-tailwindcss/postcss/types';
|
|
6
6
|
import 'magic-string';
|
|
7
7
|
import 'postcss';
|
|
8
8
|
import 'tailwindcss-patch';
|
package/dist/webpack4.js
CHANGED
|
@@ -10,33 +10,32 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk4TTPYMVMjs = require('./chunk-4TTPYMVM.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk7LKMJZD2js = require('./chunk-7LKMJZD2.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var _chunkNOKJXG3Wjs = require('./chunk-NOKJXG3W.js');
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
|
|
30
|
+
var _chunkLYGLQCWIjs = require('./chunk-LYGLQCWI.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
34
|
-
require('./chunk-
|
|
35
|
-
require('./chunk-ACTJYB33.js');
|
|
33
|
+
var _chunk5KSBT6GUjs = require('./chunk-5KSBT6GU.js');
|
|
34
|
+
require('./chunk-LL3QUKJI.js');
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
39
|
-
require('./chunk-
|
|
38
|
+
require('./chunk-CRDOWYG4.js');
|
|
40
39
|
|
|
41
40
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
42
41
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -60,7 +59,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
60
59
|
debug: debug2
|
|
61
60
|
} = options;
|
|
62
61
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
63
|
-
compiler.hooks.emit.tapPromise(
|
|
62
|
+
compiler.hooks.emit.tapPromise(_chunkLYGLQCWIjs.pluginName, async (compilation) => {
|
|
64
63
|
await runtimeState.patchPromise;
|
|
65
64
|
compilerOptions.onStart();
|
|
66
65
|
debug2("start");
|
|
@@ -69,20 +68,20 @@ function setupWebpackV4EmitHook(options) {
|
|
|
69
68
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
|
-
const assetHashByChunk =
|
|
71
|
+
const assetHashByChunk = _chunk4TTPYMVMjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
73
72
|
const assets = compilation.assets;
|
|
74
73
|
const entries = Object.entries(assets);
|
|
75
74
|
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
76
75
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
77
76
|
for (const [file] of entries) {
|
|
78
77
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
79
|
-
const absolute =
|
|
78
|
+
const absolute = _chunk7LKMJZD2js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
80
79
|
jsAssets.set(absolute, file);
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
const moduleGraphOptions = {
|
|
84
83
|
resolve(specifier, importer) {
|
|
85
|
-
return
|
|
84
|
+
return _chunk7LKMJZD2js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
86
85
|
},
|
|
87
86
|
load: (id) => {
|
|
88
87
|
const assetName = jsAssets.get(id);
|
|
@@ -146,7 +145,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
146
145
|
return created;
|
|
147
146
|
};
|
|
148
147
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
149
|
-
const runtimeSet = await
|
|
148
|
+
const runtimeSet = await _chunkLYGLQCWIjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
150
149
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
151
150
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
152
151
|
forceCollect: true,
|
|
@@ -164,7 +163,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
164
163
|
const cacheKey = file;
|
|
165
164
|
const chunkHash = assetHashByChunk.get(file);
|
|
166
165
|
tasks.push(
|
|
167
|
-
|
|
166
|
+
_chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
168
167
|
cache: compilerOptions.cache,
|
|
169
168
|
cacheKey,
|
|
170
169
|
hashKey: `${file}:asset`,
|
|
@@ -192,22 +191,23 @@ function setupWebpackV4EmitHook(options) {
|
|
|
192
191
|
const jsTaskFactories = [];
|
|
193
192
|
if (Array.isArray(groupedEntries.js)) {
|
|
194
193
|
for (const [file] of groupedEntries.js) {
|
|
195
|
-
const cacheKey =
|
|
194
|
+
const cacheKey = _chunk4TTPYMVMjs.getCacheKey.call(void 0, file);
|
|
196
195
|
const assetSource = compilation.assets[file];
|
|
197
196
|
if (!assetSource) {
|
|
198
197
|
continue;
|
|
199
198
|
}
|
|
200
199
|
const initialValue = assetSource.source();
|
|
201
200
|
const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
|
|
202
|
-
const absoluteFile =
|
|
201
|
+
const absoluteFile = _chunk7LKMJZD2js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
203
202
|
const chunkHash = assetHashByChunk.get(file);
|
|
203
|
+
const sourceAwareHash = chunkHash ? `${chunkHash}:${compilerOptions.cache.computeHash(initialRawSource)}` : void 0;
|
|
204
204
|
jsTaskFactories.push(async () => {
|
|
205
|
-
await
|
|
205
|
+
await _chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
206
206
|
cache: compilerOptions.cache,
|
|
207
207
|
cacheKey,
|
|
208
208
|
hashKey: `${file}:asset`,
|
|
209
209
|
rawSource: initialRawSource,
|
|
210
|
-
hash:
|
|
210
|
+
hash: sourceAwareHash,
|
|
211
211
|
applyResult(source) {
|
|
212
212
|
compilation.updateAsset(file, source);
|
|
213
213
|
},
|
|
@@ -246,7 +246,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
246
246
|
const cacheKey = file;
|
|
247
247
|
const chunkHash = assetHashByChunk.get(file);
|
|
248
248
|
tasks.push(
|
|
249
|
-
|
|
249
|
+
_chunkOF6MFURRjs.processCachedTask.call(void 0, {
|
|
250
250
|
cache: compilerOptions.cache,
|
|
251
251
|
cacheKey,
|
|
252
252
|
hashKey: `${file}:asset`,
|
|
@@ -272,7 +272,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
272
272
|
);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
|
|
275
|
+
_chunk7LKMJZD2js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
276
276
|
await Promise.all(tasks);
|
|
277
277
|
debug2("end");
|
|
278
278
|
compilerOptions.onEnd();
|
|
@@ -295,9 +295,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
295
|
getClassSetInLoader,
|
|
296
296
|
debug: debug2
|
|
297
297
|
} = options;
|
|
298
|
-
const isMpxApp =
|
|
298
|
+
const isMpxApp = _chunk4TTPYMVMjs.isMpx.call(void 0, appType);
|
|
299
299
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
300
|
-
|
|
300
|
+
_chunk4TTPYMVMjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
301
301
|
}
|
|
302
302
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
303
303
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -310,12 +310,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
310
310
|
const classSetLoaderOptions = {
|
|
311
311
|
getClassSet: getClassSetInLoader
|
|
312
312
|
};
|
|
313
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
313
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunk4TTPYMVMjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
314
314
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
315
315
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
316
316
|
} : void 0;
|
|
317
317
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
318
|
-
|
|
318
|
+
_chunk4TTPYMVMjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
319
319
|
}
|
|
320
320
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
321
321
|
loader: runtimeClassSetLoader,
|
|
@@ -334,19 +334,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
334
334
|
type: null
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
|
-
compiler.hooks.compilation.tap(
|
|
338
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
337
|
+
compiler.hooks.compilation.tap(_chunkLYGLQCWIjs.pluginName, (compilation) => {
|
|
338
|
+
compilation.hooks.normalModuleLoader.tap(_chunkLYGLQCWIjs.pluginName, (_loaderContext, module) => {
|
|
339
339
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
340
340
|
if (!hasRuntimeLoader) {
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
if (shouldRewriteCssImports &&
|
|
344
|
-
|
|
343
|
+
if (shouldRewriteCssImports && _chunk4TTPYMVMjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
344
|
+
_chunk4TTPYMVMjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
345
345
|
}
|
|
346
346
|
const loaderEntries = module.loaders || [];
|
|
347
347
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
348
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
349
|
-
const isCssModule =
|
|
349
|
+
const isCssModule = _chunk4TTPYMVMjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
350
350
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
351
351
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
352
352
|
}
|
|
@@ -380,7 +380,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
380
380
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
if (runtimeClassSetLoaderExists && !
|
|
383
|
+
if (runtimeClassSetLoaderExists && !_chunk4TTPYMVMjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
384
384
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
385
385
|
if (anchorIndex === -1) {
|
|
386
386
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -394,11 +394,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
397
|
-
var debug =
|
|
398
|
-
var weappTailwindcssPackageDir =
|
|
397
|
+
var debug = _chunkLYGLQCWIjs.createDebug.call(void 0, );
|
|
398
|
+
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
399
399
|
var UnifiedWebpackPluginV4 = class {
|
|
400
400
|
constructor(options = {}) {
|
|
401
|
-
this.options =
|
|
401
|
+
this.options = _chunkLYGLQCWIjs.getCompilerContext.call(void 0, options);
|
|
402
402
|
this.appType = this.options.appType;
|
|
403
403
|
}
|
|
404
404
|
apply(compiler) {
|
|
@@ -411,22 +411,22 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
411
411
|
twPatcher: initialTwPatcher,
|
|
412
412
|
refreshTailwindcssPatcher
|
|
413
413
|
} = this.options;
|
|
414
|
-
const disabledOptions =
|
|
414
|
+
const disabledOptions = _chunk7LKMJZD2js.resolveDisabledOptions.call(void 0, disabled);
|
|
415
415
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
416
416
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
417
|
-
const isMpxApp =
|
|
417
|
+
const isMpxApp = _chunk4TTPYMVMjs.isMpx.call(void 0, this.appType);
|
|
418
418
|
if (shouldRewriteCssImports) {
|
|
419
|
-
|
|
419
|
+
_chunk4TTPYMVMjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
420
420
|
pkgDir: weappTailwindcssPackageDir,
|
|
421
421
|
enabled: true,
|
|
422
422
|
appType: this.appType
|
|
423
423
|
});
|
|
424
|
-
|
|
424
|
+
_chunk4TTPYMVMjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
425
425
|
}
|
|
426
426
|
if (disabledOptions.plugin) {
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const patchRecorderState =
|
|
429
|
+
const patchRecorderState = _chunkLYGLQCWIjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
430
430
|
source: "runtime",
|
|
431
431
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
432
432
|
});
|
|
@@ -438,17 +438,17 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
438
438
|
};
|
|
439
439
|
let runtimeSetPrepared = false;
|
|
440
440
|
let runtimeSetSignature;
|
|
441
|
-
compiler.hooks.compilation.tap(
|
|
441
|
+
compiler.hooks.compilation.tap(_chunkLYGLQCWIjs.pluginName, () => {
|
|
442
442
|
runtimeSetPrepared = false;
|
|
443
443
|
});
|
|
444
444
|
async function getClassSetInLoader() {
|
|
445
445
|
if (runtimeSetPrepared) {
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
448
|
-
const signature =
|
|
448
|
+
const signature = _chunk5KSBT6GUjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
449
449
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
450
450
|
runtimeSetPrepared = true;
|
|
451
|
-
await
|
|
451
|
+
await _chunkLYGLQCWIjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
452
452
|
forceRefresh,
|
|
453
453
|
forceCollect: true,
|
|
454
454
|
clearCache: forceRefresh,
|
package/dist/webpack4.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isMpx,
|
|
11
11
|
patchMpxLoaderResolve,
|
|
12
12
|
setupMpxTailwindcssRedirect
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SJ3SG6DU.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -20,25 +20,24 @@ import {
|
|
|
20
20
|
} from "./chunk-F2CKKG6Q.mjs";
|
|
21
21
|
import {
|
|
22
22
|
processCachedTask
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
setupPatchRecorder
|
|
26
|
-
} from "./chunk-QYZCRG7F.mjs";
|
|
23
|
+
} from "./chunk-76S2EME4.mjs";
|
|
27
24
|
import {
|
|
28
25
|
createDebug,
|
|
29
26
|
ensureRuntimeClassSet,
|
|
30
27
|
getCompilerContext,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import
|
|
35
|
-
|
|
28
|
+
pluginName,
|
|
29
|
+
setupPatchRecorder
|
|
30
|
+
} from "./chunk-HADJCWHU.mjs";
|
|
31
|
+
import {
|
|
32
|
+
getRuntimeClassSetSignature
|
|
33
|
+
} from "./chunk-EW2K6CO5.mjs";
|
|
34
|
+
import "./chunk-23K4XDKF.mjs";
|
|
36
35
|
import {
|
|
37
36
|
getGroupedEntries
|
|
38
37
|
} from "./chunk-OOHJLO5M.mjs";
|
|
39
38
|
import {
|
|
40
39
|
__dirname
|
|
41
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-EFBQ4SQR.mjs";
|
|
42
41
|
|
|
43
42
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
44
43
|
import process3 from "process";
|
|
@@ -203,13 +202,14 @@ function setupWebpackV4EmitHook(options) {
|
|
|
203
202
|
const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
|
|
204
203
|
const absoluteFile = toAbsoluteOutputPath(file, outputDir);
|
|
205
204
|
const chunkHash = assetHashByChunk.get(file);
|
|
205
|
+
const sourceAwareHash = chunkHash ? `${chunkHash}:${compilerOptions.cache.computeHash(initialRawSource)}` : void 0;
|
|
206
206
|
jsTaskFactories.push(async () => {
|
|
207
207
|
await processCachedTask({
|
|
208
208
|
cache: compilerOptions.cache,
|
|
209
209
|
cacheKey,
|
|
210
210
|
hashKey: `${file}:asset`,
|
|
211
211
|
rawSource: initialRawSource,
|
|
212
|
-
hash:
|
|
212
|
+
hash: sourceAwareHash,
|
|
213
213
|
applyResult(source) {
|
|
214
214
|
compilation.updateAsset(file, source);
|
|
215
215
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.11.0-alpha.
|
|
3
|
+
"version": "4.11.0-alpha.2",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"with-layer.css"
|
|
157
157
|
],
|
|
158
158
|
"engines": {
|
|
159
|
-
"node": "^
|
|
159
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
160
160
|
},
|
|
161
161
|
"publishConfig": {
|
|
162
162
|
"access": "public",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
},
|
|
165
165
|
"dependencies": {
|
|
166
166
|
"@ast-core/escape": "~1.0.1",
|
|
167
|
-
"@babel/parser": "~7.29.
|
|
167
|
+
"@babel/parser": "~7.29.2",
|
|
168
168
|
"@babel/traverse": "~7.29.0",
|
|
169
169
|
"@babel/types": "~7.29.0",
|
|
170
170
|
"@tailwindcss-mangle/config": "^6.1.3",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"@vue/compiler-sfc": "^3.5.30",
|
|
173
173
|
"@weapp-core/escape": "~7.0.0",
|
|
174
174
|
"@weapp-core/regex": "~1.0.1",
|
|
175
|
-
"cac": "
|
|
175
|
+
"cac": "6.7.14",
|
|
176
176
|
"debug": "~4.4.3",
|
|
177
177
|
"fast-glob": "^3.3.3",
|
|
178
178
|
"htmlparser2": "10.1.0",
|
|
@@ -181,12 +181,12 @@
|
|
|
181
181
|
"lru-cache": "10.4.3",
|
|
182
182
|
"magic-string": "0.30.21",
|
|
183
183
|
"semver": "~7.7.4",
|
|
184
|
-
"tailwindcss-patch": "
|
|
184
|
+
"tailwindcss-patch": "9.0.0",
|
|
185
185
|
"webpack-sources": "3.3.4",
|
|
186
|
-
"yaml": "^2.8.
|
|
186
|
+
"yaml": "^2.8.3",
|
|
187
187
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
|
-
"@weapp-tailwindcss/postcss": "2.1.6-alpha.
|
|
189
|
-
"@weapp-tailwindcss/shared": "1.1.3-alpha.
|
|
188
|
+
"@weapp-tailwindcss/postcss": "2.1.6-alpha.1",
|
|
189
|
+
"@weapp-tailwindcss/shared": "1.1.3-alpha.1"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|
package/dist/chunk-NOKJXG3W.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkG5NLM3ALjs = require('./chunk-G5NLM3AL.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunk4LPOQMFSjs = require('./chunk-4LPOQMFS.js');
|
|
8
|
-
|
|
9
|
-
// src/tailwindcss/recorder.ts
|
|
10
|
-
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder = _chunkG5NLM3ALjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
|
|
12
|
-
if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
|
|
13
|
-
const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
14
|
-
_chunk4LPOQMFSjs.logger.info("%s%s", prefix, recorder.message);
|
|
15
|
-
}
|
|
16
|
-
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
|
|
17
|
-
await recorder.onPatched();
|
|
18
|
-
} : void 0;
|
|
19
|
-
const patchPromise = patcher ? _chunkG5NLM3ALjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
|
-
return {
|
|
21
|
-
recorder,
|
|
22
|
-
patchPromise,
|
|
23
|
-
onPatchCompleted
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.setupPatchRecorder = setupPatchRecorder;
|
package/dist/chunk-QYZCRG7F.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createPatchTargetRecorder,
|
|
3
|
-
createTailwindPatchPromise
|
|
4
|
-
} from "./chunk-FZNYV7VH.mjs";
|
|
5
|
-
import {
|
|
6
|
-
logger
|
|
7
|
-
} from "./chunk-IEZ5RBMG.mjs";
|
|
8
|
-
|
|
9
|
-
// src/tailwindcss/recorder.ts
|
|
10
|
-
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder = createPatchTargetRecorder(baseDir, patcher, options);
|
|
12
|
-
if (recorder?.message && options?.logMessage !== false) {
|
|
13
|
-
const prefix = options?.messagePrefix ? `${options.messagePrefix} ` : "";
|
|
14
|
-
logger.info("%s%s", prefix, recorder.message);
|
|
15
|
-
}
|
|
16
|
-
const onPatchCompleted = recorder?.onPatched ? async () => {
|
|
17
|
-
await recorder.onPatched();
|
|
18
|
-
} : void 0;
|
|
19
|
-
const patchPromise = patcher ? createTailwindPatchPromise(patcher, onPatchCompleted) : Promise.resolve();
|
|
20
|
-
return {
|
|
21
|
-
recorder,
|
|
22
|
-
patchPromise,
|
|
23
|
-
onPatchCompleted
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
setupPatchRecorder
|
|
29
|
-
};
|