weapp-tailwindcss 4.9.7 → 4.9.8-alpha.0
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-FM2RNYJD.mjs → chunk-2HORYQCB.mjs} +1 -1
- package/dist/{chunk-MOOFLCLC.js → chunk-35WZBSR2.js} +3 -3
- package/dist/{chunk-LST5YX7P.mjs → chunk-5VEPZUTO.mjs} +3 -3
- package/dist/{chunk-JW43IVZB.mjs → chunk-B76ICULV.mjs} +1 -1
- package/dist/{chunk-FNFWO6S4.mjs → chunk-FY4CU2TB.mjs} +7 -5
- package/dist/{chunk-SCAC7G77.mjs → chunk-IPXH3S3C.mjs} +2 -2
- package/dist/{chunk-UE6PEJJM.js → chunk-KBLYUEKE.js} +24 -24
- package/dist/{chunk-I5PM7RZP.js → chunk-KTUGHGKO.js} +7 -7
- package/dist/{chunk-EPL2YCB5.js → chunk-KUFBWA2F.js} +7 -5
- package/dist/{chunk-TBOY7KA4.mjs → chunk-LACRPTD6.mjs} +2 -2
- package/dist/{chunk-RIUV5UO7.js → chunk-WRVALWQL.js} +13 -13
- package/dist/{chunk-NSZXONXA.js → chunk-WVE6IP6G.js} +3 -3
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +2 -2
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/{index-CPJD_vjs.d.mts → index-vGuAfNvT.d.mts} +10 -1
- package/dist/{index-CPJD_vjs.d.ts → index-vGuAfNvT.d.ts} +10 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/presets.d.mts +2 -1
- package/dist/presets.d.ts +2 -1
- package/dist/presets.js +1 -0
- package/dist/presets.mjs +1 -0
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +24 -24
- package/dist/webpack4.mjs +3 -3
- package/package.json +5 -5
package/dist/webpack4.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk35WZBSR2js = require('./chunk-35WZBSR2.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,14 +22,14 @@ var _chunkDOX3RXJ2js = require('./chunk-DOX3RXJ2.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkWVE6IP6Gjs = require('./chunk-WVE6IP6G.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkKUFBWA2Fjs = require('./chunk-KUFBWA2F.js');
|
|
33
33
|
require('./chunk-PO3CCFU7.js');
|
|
34
34
|
require('./chunk-LBZCKOMT.js');
|
|
35
35
|
|
|
@@ -53,7 +53,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
53
53
|
refreshRuntimeState,
|
|
54
54
|
debug: debug2
|
|
55
55
|
} = options;
|
|
56
|
-
compiler.hooks.emit.tapPromise(
|
|
56
|
+
compiler.hooks.emit.tapPromise(_chunkKUFBWA2Fjs.pluginName, async (compilation) => {
|
|
57
57
|
await runtimeState.patchPromise;
|
|
58
58
|
compilerOptions.onStart();
|
|
59
59
|
debug2("start");
|
|
@@ -119,7 +119,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
119
119
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
120
120
|
await refreshRuntimeState(true);
|
|
121
121
|
await runtimeState.patchPromise;
|
|
122
|
-
const runtimeSet = await
|
|
122
|
+
const runtimeSet = await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
123
123
|
debug2("get runtimeSet, class count: %d", runtimeSet.size);
|
|
124
124
|
const tasks = [];
|
|
125
125
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -156,7 +156,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
156
156
|
const jsTaskFactories = [];
|
|
157
157
|
if (Array.isArray(groupedEntries.js)) {
|
|
158
158
|
for (const [file] of groupedEntries.js) {
|
|
159
|
-
const cacheKey =
|
|
159
|
+
const cacheKey = _chunk35WZBSR2js.getCacheKey.call(void 0, file);
|
|
160
160
|
const assetSource = compilation.assets[file];
|
|
161
161
|
if (!assetSource) {
|
|
162
162
|
continue;
|
|
@@ -259,9 +259,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
259
259
|
getClassSetInLoader,
|
|
260
260
|
debug: debug2
|
|
261
261
|
} = options;
|
|
262
|
-
const isMpxApp =
|
|
262
|
+
const isMpxApp = _chunk35WZBSR2js.isMpx.call(void 0, appType);
|
|
263
263
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
264
|
-
|
|
264
|
+
_chunk35WZBSR2js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
265
265
|
}
|
|
266
266
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
267
267
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -274,12 +274,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
274
274
|
const classSetLoaderOptions = {
|
|
275
275
|
getClassSet: getClassSetInLoader
|
|
276
276
|
};
|
|
277
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
277
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunk35WZBSR2js.createLoaderAnchorFinders.call(void 0, appType);
|
|
278
278
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
279
279
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
280
280
|
} : void 0;
|
|
281
281
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
282
|
-
|
|
282
|
+
_chunk35WZBSR2js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
283
283
|
}
|
|
284
284
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
285
285
|
loader: runtimeClassSetLoader,
|
|
@@ -298,19 +298,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
298
298
|
type: null
|
|
299
299
|
};
|
|
300
300
|
};
|
|
301
|
-
compiler.hooks.compilation.tap(
|
|
302
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
301
|
+
compiler.hooks.compilation.tap(_chunkKUFBWA2Fjs.pluginName, (compilation) => {
|
|
302
|
+
compilation.hooks.normalModuleLoader.tap(_chunkKUFBWA2Fjs.pluginName, (_loaderContext, module) => {
|
|
303
303
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
304
304
|
if (!hasRuntimeLoader) {
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
if (shouldRewriteCssImports &&
|
|
308
|
-
|
|
307
|
+
if (shouldRewriteCssImports && _chunk35WZBSR2js.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
308
|
+
_chunk35WZBSR2js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
309
309
|
}
|
|
310
310
|
const loaderEntries = module.loaders || [];
|
|
311
311
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
312
312
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
313
|
-
const isCssModule =
|
|
313
|
+
const isCssModule = _chunk35WZBSR2js.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
314
314
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
315
315
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
316
316
|
}
|
|
@@ -344,7 +344,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
344
344
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
if (runtimeClassSetLoaderExists && !
|
|
347
|
+
if (runtimeClassSetLoaderExists && !_chunk35WZBSR2js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
348
348
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
349
349
|
if (anchorIndex === -1) {
|
|
350
350
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -358,11 +358,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
361
|
-
var debug =
|
|
361
|
+
var debug = _chunkKUFBWA2Fjs.createDebug.call(void 0, );
|
|
362
362
|
var weappTailwindcssPackageDir = _chunkDOX3RXJ2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
363
363
|
var UnifiedWebpackPluginV4 = class {
|
|
364
364
|
constructor(options = {}) {
|
|
365
|
-
this.options =
|
|
365
|
+
this.options = _chunkKUFBWA2Fjs.getCompilerContext.call(void 0, options);
|
|
366
366
|
this.appType = this.options.appType;
|
|
367
367
|
}
|
|
368
368
|
apply(compiler) {
|
|
@@ -378,19 +378,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
378
378
|
const disabledOptions = _chunkDOX3RXJ2js.resolveDisabledOptions.call(void 0, disabled);
|
|
379
379
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
380
380
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
381
|
-
const isMpxApp =
|
|
381
|
+
const isMpxApp = _chunk35WZBSR2js.isMpx.call(void 0, this.appType);
|
|
382
382
|
if (shouldRewriteCssImports) {
|
|
383
|
-
|
|
383
|
+
_chunk35WZBSR2js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
384
384
|
pkgDir: weappTailwindcssPackageDir,
|
|
385
385
|
enabled: true,
|
|
386
386
|
appType: this.appType
|
|
387
387
|
});
|
|
388
|
-
|
|
388
|
+
_chunk35WZBSR2js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
389
389
|
}
|
|
390
390
|
if (disabledOptions.plugin) {
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
|
-
const patchRecorderState =
|
|
393
|
+
const patchRecorderState = _chunkWVE6IP6Gjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
394
394
|
source: "runtime",
|
|
395
395
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
396
396
|
});
|
|
@@ -401,12 +401,12 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
401
401
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
402
402
|
};
|
|
403
403
|
const refreshRuntimeState = async (force) => {
|
|
404
|
-
await
|
|
404
|
+
await _chunkKUFBWA2Fjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
405
405
|
};
|
|
406
406
|
async function getClassSetInLoader() {
|
|
407
407
|
await refreshRuntimeState(true);
|
|
408
408
|
await runtimeState.patchPromise;
|
|
409
|
-
await
|
|
409
|
+
await _chunkKUFBWA2Fjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
410
410
|
}
|
|
411
411
|
onLoad();
|
|
412
412
|
setupWebpackV4Loaders({
|
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-2HORYQCB.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-B76ICULV.mjs";
|
|
26
26
|
import {
|
|
27
27
|
collectRuntimeClassSet,
|
|
28
28
|
createDebug,
|
|
29
29
|
getCompilerContext,
|
|
30
30
|
pluginName,
|
|
31
31
|
refreshTailwindRuntimeState
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-FY4CU2TB.mjs";
|
|
33
33
|
import "./chunk-7D27E7TU.mjs";
|
|
34
34
|
import "./chunk-EGOFMIDI.mjs";
|
|
35
35
|
import {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.8-alpha.0",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -164,9 +164,9 @@
|
|
|
164
164
|
},
|
|
165
165
|
"dependencies": {
|
|
166
166
|
"@ast-core/escape": "~1.0.1",
|
|
167
|
-
"@babel/parser": "~7.
|
|
168
|
-
"@babel/traverse": "~7.
|
|
169
|
-
"@babel/types": "~7.
|
|
167
|
+
"@babel/parser": "~7.29.0",
|
|
168
|
+
"@babel/traverse": "~7.29.0",
|
|
169
|
+
"@babel/types": "~7.29.0",
|
|
170
170
|
"@tailwindcss-mangle/config": "^6.1.0",
|
|
171
171
|
"@vue/compiler-dom": "^3.5.27",
|
|
172
172
|
"@vue/compiler-sfc": "^3.5.27",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
187
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
|
-
"@weapp-tailwindcss/postcss": "2.1.
|
|
188
|
+
"@weapp-tailwindcss/postcss": "2.1.4-alpha.0",
|
|
189
189
|
"@weapp-tailwindcss/shared": "1.1.2"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|