weapp-tailwindcss 4.9.0-alpha.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-55DZTCIR.js → chunk-65CKEW6P.js} +24 -24
- package/dist/{chunk-I7OZD2MH.mjs → chunk-7JV2EGN7.mjs} +4 -4
- package/dist/{chunk-PT4IJT3Q.js → chunk-APJY6PQW.js} +2 -2
- package/dist/{chunk-GFC7MQHN.mjs → chunk-BC6TZREM.mjs} +2 -2
- package/dist/{chunk-KDURGAC7.js → chunk-BIFOYWIB.js} +80 -57
- package/dist/{chunk-OQ2K6ETP.js → chunk-CYKRAS6K.js} +14 -14
- package/dist/chunk-DYLQ6UOI.js +71 -0
- package/dist/{chunk-LUFUZYVB.js → chunk-F4HOQ6DE.js} +7 -7
- package/dist/{chunk-6R4BK6D6.js → chunk-FYYBY3VK.js} +5 -5
- package/dist/{chunk-SZOXLSNK.mjs → chunk-HEBIKTBC.mjs} +1 -1
- package/dist/{chunk-TFOTUR4L.mjs → chunk-HWF5U4CI.mjs} +1 -1
- package/dist/{chunk-ZQLZCQL3.mjs → chunk-J4FEPPRP.mjs} +60 -37
- package/dist/{chunk-2WMBYV66.mjs → chunk-O35YNDUX.mjs} +1 -1
- package/dist/{chunk-RR5HCKVQ.mjs → chunk-OOHJLO5M.mjs} +26 -0
- package/dist/{chunk-TRZWVCFI.mjs → chunk-VNGPHRAS.mjs} +2 -2
- package/dist/{chunk-TDU6NN6W.mjs → chunk-W33YZK2C.mjs} +4 -4
- package/dist/{chunk-BWNTLOVR.js → chunk-WOJCMQDF.js} +5 -5
- package/dist/{chunk-MJW6ZJID.js → chunk-YDM2M3NT.js} +3 -3
- package/dist/cli.js +40 -40
- package/dist/cli.mjs +4 -4
- package/dist/core.js +11 -11
- package/dist/core.mjs +5 -5
- package/dist/css-macro.js +2 -2
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +6 -6
- package/dist/index.js +10 -10
- package/dist/index.mjs +9 -9
- package/dist/presets.js +12 -8
- package/dist/presets.mjs +8 -4
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +6 -6
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +7 -7
- package/dist/webpack4.js +27 -27
- package/dist/webpack4.mjs +6 -6
- package/package.json +1 -1
- package/dist/chunk-FMBPNII7.js +0 -45
package/dist/webpack.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-7JV2EGN7.mjs";
|
|
5
|
+
import "./chunk-O35YNDUX.mjs";
|
|
6
6
|
import "./chunk-3SKEY32E.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BC6TZREM.mjs";
|
|
9
|
+
import "./chunk-W33YZK2C.mjs";
|
|
10
|
+
import "./chunk-HEBIKTBC.mjs";
|
|
11
|
+
import "./chunk-HWF5U4CI.mjs";
|
|
12
|
+
import "./chunk-OOHJLO5M.mjs";
|
|
13
13
|
import "./chunk-SM5V25IN.mjs";
|
|
14
14
|
export {
|
|
15
15
|
UnifiedWebpackPluginV5,
|
package/dist/webpack4.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkYDM2M3NTjs = require('./chunk-YDM2M3NT.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,19 +22,19 @@ var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
|
22
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkWOJCMQDFjs = require('./chunk-WOJCMQDF.js');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
33
|
-
require('./chunk-
|
|
34
|
-
require('./chunk-
|
|
32
|
+
var _chunkCYKRAS6Kjs = require('./chunk-CYKRAS6K.js');
|
|
33
|
+
require('./chunk-APJY6PQW.js');
|
|
34
|
+
require('./chunk-FYYBY3VK.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
38
38
|
require('./chunk-MB4BR57E.js');
|
|
39
39
|
|
|
40
40
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
@@ -42,11 +42,11 @@ 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 =
|
|
45
|
+
var debug = _chunkCYKRAS6Kjs.createDebug.call(void 0, );
|
|
46
46
|
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
47
47
|
var UnifiedWebpackPluginV4 = class {
|
|
48
48
|
constructor(options = {}) {
|
|
49
|
-
this.options =
|
|
49
|
+
this.options = _chunkCYKRAS6Kjs.getCompilerContext.call(void 0, options);
|
|
50
50
|
this.appType = this.options.appType;
|
|
51
51
|
}
|
|
52
52
|
apply(compiler) {
|
|
@@ -70,19 +70,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
70
70
|
const disabledOptions = _chunkORSWL3MIjs.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 = _chunkYDM2M3NTjs.isMpx.call(void 0, this.appType);
|
|
74
74
|
if (shouldRewriteCssImports) {
|
|
75
|
-
|
|
75
|
+
_chunkYDM2M3NTjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
76
76
|
pkgDir: weappTailwindcssPackageDir,
|
|
77
77
|
enabled: true,
|
|
78
78
|
appType: this.appType
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
_chunkYDM2M3NTjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
81
81
|
}
|
|
82
82
|
if (disabledOptions.plugin) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const patchRecorderState =
|
|
85
|
+
const patchRecorderState = _chunkWOJCMQDFjs.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 _chunkCYKRAS6Kjs.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 _chunkCYKRAS6Kjs.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 } = _chunkYDM2M3NTjs.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
|
+
_chunkYDM2M3NTjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
121
121
|
}
|
|
122
122
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
123
|
-
|
|
123
|
+
_chunkYDM2M3NTjs.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(_chunkCYKRAS6Kjs.pluginName, (compilation) => {
|
|
143
|
+
compilation.hooks.normalModuleLoader.tap(_chunkCYKRAS6Kjs.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 && _chunkYDM2M3NTjs.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
|
|
149
|
+
_chunkYDM2M3NTjs.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 = _chunkYDM2M3NTjs.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 && !_chunkYDM2M3NTjs.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(_chunkCYKRAS6Kjs.pluginName, async (compilation) => {
|
|
200
200
|
await runtimeState.patchPromise;
|
|
201
201
|
onStart();
|
|
202
202
|
debug("start");
|
|
@@ -259,10 +259,10 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
259
259
|
debug("js linked handle: %s", assetName);
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
-
const groupedEntries =
|
|
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 _chunkCYKRAS6Kjs.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,7 +299,7 @@ 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 = _chunkYDM2M3NTjs.getCacheKey.call(void 0, file);
|
|
303
303
|
const assetSource = compilation.assets[file];
|
|
304
304
|
if (!assetSource) {
|
|
305
305
|
continue;
|
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-O35YNDUX.mjs";
|
|
13
13
|
import {
|
|
14
14
|
pushConcurrentTaskFactories,
|
|
15
15
|
resolveDisabledOptions,
|
|
@@ -22,19 +22,19 @@ import {
|
|
|
22
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
23
23
|
import {
|
|
24
24
|
setupPatchRecorder
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BC6TZREM.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-
|
|
34
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-W33YZK2C.mjs";
|
|
33
|
+
import "./chunk-HEBIKTBC.mjs";
|
|
34
|
+
import "./chunk-HWF5U4CI.mjs";
|
|
35
35
|
import {
|
|
36
36
|
getGroupedEntries
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-OOHJLO5M.mjs";
|
|
38
38
|
import {
|
|
39
39
|
__dirname
|
|
40
40
|
} from "./chunk-SM5V25IN.mjs";
|
package/package.json
CHANGED
package/dist/chunk-FMBPNII7.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/utils/index.ts
|
|
2
|
-
var _shared = require('@weapp-tailwindcss/shared');
|
|
3
|
-
|
|
4
|
-
// src/utils/hbuilderx.ts
|
|
5
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
6
|
-
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
7
|
-
|
|
8
|
-
// src/utils/index.ts
|
|
9
|
-
function classifyEntry(filename, options) {
|
|
10
|
-
if (options.cssMatcher(filename)) {
|
|
11
|
-
return "css";
|
|
12
|
-
}
|
|
13
|
-
if (options.htmlMatcher(filename)) {
|
|
14
|
-
return "html";
|
|
15
|
-
}
|
|
16
|
-
if (options.jsMatcher(filename) || options.wxsMatcher(filename)) {
|
|
17
|
-
return "js";
|
|
18
|
-
}
|
|
19
|
-
return "other";
|
|
20
|
-
}
|
|
21
|
-
function createEmptyGroups() {
|
|
22
|
-
return {
|
|
23
|
-
css: [],
|
|
24
|
-
html: [],
|
|
25
|
-
js: [],
|
|
26
|
-
other: []
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function getGroupedEntries(entries, options) {
|
|
30
|
-
const groups = createEmptyGroups();
|
|
31
|
-
for (const entry of entries) {
|
|
32
|
-
const [filename] = entry;
|
|
33
|
-
const group = classifyEntry(filename, options);
|
|
34
|
-
groups[group].push(entry);
|
|
35
|
-
}
|
|
36
|
-
return groups;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
exports.defu = _shared.defu; exports.defuOverrideArray = _shared.defuOverrideArray; exports.isMap = _shared.isMap; exports.noop = _shared.noop; exports.getGroupedEntries = getGroupedEntries;
|