weapp-tailwindcss 4.9.1 → 4.9.2-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-ORSWL3MI.js → chunk-2WPTDMN3.js} +2 -2
- package/dist/{chunk-APJY6PQW.js → chunk-5O6237HX.js} +55 -31
- package/dist/{chunk-J4FEPPRP.mjs → chunk-6HBFEXOW.mjs} +2 -2
- package/dist/{chunk-7JV2EGN7.mjs → chunk-CF7VDUIE.mjs} +4 -4
- package/dist/{chunk-SM5V25IN.mjs → chunk-FFGR5V3H.mjs} +1 -1
- package/dist/{chunk-CYKRAS6K.js → chunk-J7KULRTR.js} +7 -7
- package/dist/{chunk-VNGPHRAS.mjs → chunk-JOLM54PI.mjs} +2 -2
- package/dist/{chunk-WOJCMQDF.js → chunk-KA2JONAP.js} +5 -5
- package/dist/{chunk-BIFOYWIB.js → chunk-NGRAUBWU.js} +23 -23
- package/dist/{chunk-65CKEW6P.js → chunk-OGG7WXHZ.js} +29 -29
- package/dist/{chunk-W33YZK2C.mjs → chunk-OU2OBBPZ.mjs} +2 -2
- package/dist/{chunk-O35YNDUX.mjs → chunk-QA5NZSGN.mjs} +1 -1
- package/dist/{chunk-MB4BR57E.js → chunk-UAEME5HT.js} +1 -1
- package/dist/{chunk-YDM2M3NT.js → chunk-W4XFWZB5.js} +5 -5
- package/dist/{chunk-BC6TZREM.mjs → chunk-XWGIWOHV.mjs} +2 -2
- package/dist/{chunk-F4HOQ6DE.js → chunk-YBTRKOE2.js} +7 -7
- package/dist/{chunk-HEBIKTBC.mjs → chunk-ZE7JKKFT.mjs} +39 -15
- package/dist/cli.js +39 -39
- package/dist/cli.mjs +3 -3
- package/dist/core.js +10 -10
- package/dist/core.mjs +4 -4
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/index.js +10 -10
- package/dist/index.mjs +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- 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.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +5 -5
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.js +32 -32
- package/dist/webpack4.mjs +5 -5
- package/package.json +2 -2
package/dist/webpack.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkOGG7WXHZjs = require('./chunk-OGG7WXHZ.js');
|
|
5
|
+
require('./chunk-W4XFWZB5.js');
|
|
6
|
+
require('./chunk-2WPTDMN3.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-KA2JONAP.js');
|
|
9
|
+
require('./chunk-J7KULRTR.js');
|
|
10
|
+
require('./chunk-5O6237HX.js');
|
|
11
11
|
require('./chunk-FYYBY3VK.js');
|
|
12
12
|
require('./chunk-DYLQ6UOI.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-UAEME5HT.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkOGG7WXHZjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkOGG7WXHZjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-CF7VDUIE.mjs";
|
|
5
|
+
import "./chunk-QA5NZSGN.mjs";
|
|
6
6
|
import "./chunk-3SKEY32E.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-XWGIWOHV.mjs";
|
|
9
|
+
import "./chunk-OU2OBBPZ.mjs";
|
|
10
|
+
import "./chunk-ZE7JKKFT.mjs";
|
|
11
11
|
import "./chunk-HWF5U4CI.mjs";
|
|
12
12
|
import "./chunk-OOHJLO5M.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FFGR5V3H.mjs";
|
|
14
14
|
export {
|
|
15
15
|
UnifiedWebpackPluginV5,
|
|
16
16
|
weappTailwindcssPackageDir
|
package/dist/webpack4.js
CHANGED
|
@@ -9,44 +9,44 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkW4XFWZB5js = require('./chunk-W4XFWZB5.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkKA2JONAPjs = require('./chunk-KA2JONAP.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
33
|
-
require('./chunk-
|
|
32
|
+
var _chunkJ7KULRTRjs = require('./chunk-J7KULRTR.js');
|
|
33
|
+
require('./chunk-5O6237HX.js');
|
|
34
34
|
require('./chunk-FYYBY3VK.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
38
|
-
require('./chunk-
|
|
38
|
+
require('./chunk-UAEME5HT.js');
|
|
39
39
|
|
|
40
40
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
41
41
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
42
42
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
43
43
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
44
44
|
var _webpacksources = require('webpack-sources');
|
|
45
|
-
var debug =
|
|
46
|
-
var weappTailwindcssPackageDir =
|
|
45
|
+
var debug = _chunkJ7KULRTRjs.createDebug.call(void 0, );
|
|
46
|
+
var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
47
47
|
var UnifiedWebpackPluginV4 = class {
|
|
48
48
|
constructor(options = {}) {
|
|
49
|
-
this.options =
|
|
49
|
+
this.options = _chunkJ7KULRTRjs.getCompilerContext.call(void 0, options);
|
|
50
50
|
this.appType = this.options.appType;
|
|
51
51
|
}
|
|
52
52
|
apply(compiler) {
|
|
@@ -67,22 +67,22 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
67
67
|
twPatcher: initialTwPatcher,
|
|
68
68
|
refreshTailwindcssPatcher
|
|
69
69
|
} = this.options;
|
|
70
|
-
const disabledOptions =
|
|
70
|
+
const disabledOptions = _chunk2WPTDMN3js.resolveDisabledOptions.call(void 0, disabled);
|
|
71
71
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
72
72
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
73
|
-
const isMpxApp =
|
|
73
|
+
const isMpxApp = _chunkW4XFWZB5js.isMpx.call(void 0, this.appType);
|
|
74
74
|
if (shouldRewriteCssImports) {
|
|
75
|
-
|
|
75
|
+
_chunkW4XFWZB5js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
76
76
|
pkgDir: weappTailwindcssPackageDir,
|
|
77
77
|
enabled: true,
|
|
78
78
|
appType: this.appType
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
_chunkW4XFWZB5js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
81
81
|
}
|
|
82
82
|
if (disabledOptions.plugin) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const patchRecorderState =
|
|
85
|
+
const patchRecorderState = _chunkKA2JONAPjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
86
86
|
source: "runtime",
|
|
87
87
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
88
88
|
});
|
|
@@ -93,12 +93,12 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
93
93
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
94
94
|
};
|
|
95
95
|
const refreshRuntimeState = async (force) => {
|
|
96
|
-
await
|
|
96
|
+
await _chunkJ7KULRTRjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
97
97
|
};
|
|
98
98
|
async function getClassSetInLoader() {
|
|
99
99
|
await refreshRuntimeState(true);
|
|
100
100
|
await runtimeState.patchPromise;
|
|
101
|
-
await
|
|
101
|
+
await _chunkJ7KULRTRjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
102
102
|
}
|
|
103
103
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
104
104
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -111,16 +111,16 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
111
111
|
const classSetLoaderOptions = {
|
|
112
112
|
getClassSet: getClassSetInLoader
|
|
113
113
|
};
|
|
114
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
114
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkW4XFWZB5js.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
115
115
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
116
116
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
117
117
|
} : void 0;
|
|
118
118
|
onLoad();
|
|
119
119
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
120
|
-
|
|
120
|
+
_chunkW4XFWZB5js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
121
121
|
}
|
|
122
122
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
123
|
-
|
|
123
|
+
_chunkW4XFWZB5js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
124
124
|
}
|
|
125
125
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
126
126
|
loader: runtimeClassSetLoader,
|
|
@@ -139,19 +139,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
139
139
|
type: null
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
|
-
compiler.hooks.compilation.tap(
|
|
143
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
142
|
+
compiler.hooks.compilation.tap(_chunkJ7KULRTRjs.pluginName, (compilation) => {
|
|
143
|
+
compilation.hooks.normalModuleLoader.tap(_chunkJ7KULRTRjs.pluginName, (_loaderContext, module) => {
|
|
144
144
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
145
145
|
if (!hasRuntimeLoader) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
if (shouldRewriteCssImports &&
|
|
149
|
-
|
|
148
|
+
if (shouldRewriteCssImports && _chunkW4XFWZB5js.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
|
|
149
|
+
_chunkW4XFWZB5js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, true);
|
|
150
150
|
}
|
|
151
151
|
const loaderEntries = module.loaders || [];
|
|
152
152
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
153
153
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
154
|
-
const isCssModule =
|
|
154
|
+
const isCssModule = _chunkW4XFWZB5js.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
155
155
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
156
156
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
157
157
|
}
|
|
@@ -185,7 +185,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
185
185
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
if (runtimeClassSetLoaderExists && !
|
|
188
|
+
if (runtimeClassSetLoaderExists && !_chunkW4XFWZB5js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
189
189
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
190
190
|
if (anchorIndex === -1) {
|
|
191
191
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -196,7 +196,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
|
-
compiler.hooks.emit.tapPromise(
|
|
199
|
+
compiler.hooks.emit.tapPromise(_chunkJ7KULRTRjs.pluginName, async (compilation) => {
|
|
200
200
|
await runtimeState.patchPromise;
|
|
201
201
|
onStart();
|
|
202
202
|
debug("start");
|
|
@@ -211,13 +211,13 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
211
211
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
212
212
|
for (const [file] of entries) {
|
|
213
213
|
if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
|
|
214
|
-
const absolute =
|
|
214
|
+
const absolute = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
215
215
|
jsAssets.set(absolute, file);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
const moduleGraphOptions = {
|
|
219
219
|
resolve(specifier, importer) {
|
|
220
|
-
return
|
|
220
|
+
return _chunk2WPTDMN3js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
221
221
|
},
|
|
222
222
|
load: (id) => {
|
|
223
223
|
const assetName = jsAssets.get(id);
|
|
@@ -262,7 +262,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
262
262
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, this.options);
|
|
263
263
|
await refreshRuntimeState(true);
|
|
264
264
|
await runtimeState.patchPromise;
|
|
265
|
-
const runtimeSet = await
|
|
265
|
+
const runtimeSet = await _chunkJ7KULRTRjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
266
266
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
267
267
|
const tasks = [];
|
|
268
268
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -299,14 +299,14 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
299
299
|
const jsTaskFactories = [];
|
|
300
300
|
if (Array.isArray(groupedEntries.js)) {
|
|
301
301
|
for (const [file] of groupedEntries.js) {
|
|
302
|
-
const cacheKey =
|
|
302
|
+
const cacheKey = _chunkW4XFWZB5js.getCacheKey.call(void 0, file);
|
|
303
303
|
const assetSource = compilation.assets[file];
|
|
304
304
|
if (!assetSource) {
|
|
305
305
|
continue;
|
|
306
306
|
}
|
|
307
307
|
const initialValue = assetSource.source();
|
|
308
308
|
const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
|
|
309
|
-
const absoluteFile =
|
|
309
|
+
const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
310
310
|
jsTaskFactories.push(async () => {
|
|
311
311
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
312
312
|
cache,
|
|
@@ -379,7 +379,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
_chunk2WPTDMN3js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
383
383
|
await Promise.all(tasks);
|
|
384
384
|
debug("end");
|
|
385
385
|
onEnd();
|
package/dist/webpack4.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isMpx,
|
|
10
10
|
patchMpxLoaderResolve,
|
|
11
11
|
setupMpxTailwindcssRedirect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QA5NZSGN.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,22 +22,22 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XWGIWOHV.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-OU2OBBPZ.mjs";
|
|
33
|
+
import "./chunk-ZE7JKKFT.mjs";
|
|
34
34
|
import "./chunk-HWF5U4CI.mjs";
|
|
35
35
|
import {
|
|
36
36
|
getGroupedEntries
|
|
37
37
|
} from "./chunk-OOHJLO5M.mjs";
|
|
38
38
|
import {
|
|
39
39
|
__dirname
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-FFGR5V3H.mjs";
|
|
41
41
|
|
|
42
42
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
43
43
|
import fs from "fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.2-alpha.2",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"lru-cache": "10.4.3",
|
|
182
182
|
"magic-string": "0.30.21",
|
|
183
183
|
"semver": "~7.7.3",
|
|
184
|
-
"tailwindcss-patch": "^8.6.
|
|
184
|
+
"tailwindcss-patch": "^8.6.1",
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
187
|
"@weapp-tailwindcss/postcss": "2.1.0",
|