weapp-tailwindcss 3.0.2 → 3.0.4
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/README.md +6 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +8 -0
- package/dist/cli.js +16 -7
- package/dist/cli.mjs +12 -7
- package/dist/constants.d.ts +1 -0
- package/dist/core.js +2 -2
- package/dist/core.mjs +2 -2
- package/dist/css-macro/index.js +1 -1
- package/dist/gulp.js +5 -66
- package/dist/gulp.mjs +4 -65
- package/dist/index-8OJKpYld.js +70 -0
- package/dist/{postcss-zkCNv4BC.js → index-Fkmyt0Rc.js} +55 -26
- package/dist/index-KpA8Y68V.js +142 -0
- package/dist/index-O8jpXUxP.mjs +140 -0
- package/dist/{postcss-irzTcRfl.mjs → index-_74RBzwy.mjs} +54 -26
- package/dist/{index-z25r_Htj.js → index-juOeq2Kt.js} +1 -1
- package/dist/index-u-U9HdG6.mjs +64 -0
- package/dist/index.js +9 -9
- package/dist/index.mjs +5 -5
- package/dist/{options-UXRHB24i.mjs → options-6YPFqoRJ.mjs} +2 -2
- package/dist/{options-5eiKwcXx.js → options-N9g3FpWO.js} +3 -3
- package/dist/postcss/plugins/ctx.d.ts +2 -0
- package/dist/postcss/selectorParser.d.ts +4 -1
- package/dist/postcss.js +7 -7
- package/dist/postcss.mjs +1 -1
- package/dist/replace.js +5 -5
- package/dist/v5-RkdOexPP.js +187 -0
- package/dist/v5-UTJ5AaEA.mjs +180 -0
- package/dist/vite.js +11 -142
- package/dist/vite.mjs +9 -144
- package/dist/weapp-tw-runtime-loader.js +1 -1
- package/dist/webpack.js +12 -186
- package/dist/webpack.mjs +11 -184
- package/dist/webpack4.d.ts +1 -0
- package/dist/webpack4.js +208 -0
- package/dist/webpack4.mjs +199 -0
- package/package.json +35 -26
package/dist/webpack4.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var options = require('./options-N9g3FpWO.js');
|
|
6
|
+
var path = require('node:path');
|
|
7
|
+
var fs = require('node:fs');
|
|
8
|
+
var webpackSources = require('webpack-sources');
|
|
9
|
+
var index = require('./index-Fkmyt0Rc.js');
|
|
10
|
+
var defaults = require('./defaults-QOAV8NSV.js');
|
|
11
|
+
var index$1 = require('./index-juOeq2Kt.js');
|
|
12
|
+
require('magic-string');
|
|
13
|
+
require('./replace.js');
|
|
14
|
+
require('@weapp-core/escape');
|
|
15
|
+
require('@ast-core/escape');
|
|
16
|
+
require('./shared-AxeHlAoJ.js');
|
|
17
|
+
require('@weapp-core/regex');
|
|
18
|
+
require('@babel/generator');
|
|
19
|
+
require('@babel/parser');
|
|
20
|
+
require('@babel/traverse');
|
|
21
|
+
require('@babel/types');
|
|
22
|
+
require('htmlparser2');
|
|
23
|
+
require('postcss');
|
|
24
|
+
require('semver');
|
|
25
|
+
require('tailwindcss-patch');
|
|
26
|
+
require('@tailwindcss-mangle/shared');
|
|
27
|
+
require('lru-cache');
|
|
28
|
+
require('md5');
|
|
29
|
+
require('@csstools/postcss-is-pseudo-class');
|
|
30
|
+
require('postcss-rem-to-responsive-pixel');
|
|
31
|
+
require('postcss-selector-parser');
|
|
32
|
+
require('./defu-KWuJnZLV.js');
|
|
33
|
+
require('debug');
|
|
34
|
+
|
|
35
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
36
|
+
|
|
37
|
+
var path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
38
|
+
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
39
|
+
|
|
40
|
+
const debug = index$1.createDebug('processAssets: ');
|
|
41
|
+
class UnifiedWebpackPluginV4 {
|
|
42
|
+
constructor(options$1 = {}) {
|
|
43
|
+
if (options$1.customReplaceDictionary === undefined) {
|
|
44
|
+
options$1.customReplaceDictionary = 'simple';
|
|
45
|
+
}
|
|
46
|
+
this.options = options.getOptions(options$1);
|
|
47
|
+
this.appType = this.options.appType;
|
|
48
|
+
}
|
|
49
|
+
apply(compiler) {
|
|
50
|
+
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch, templateHandler, jsHandler, setMangleRuntimeSet, runtimeLoaderPath, cache, tailwindcssBasedir } = this.options;
|
|
51
|
+
if (disabled) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
55
|
+
const twPatcher = options.createTailwindcssPatcher();
|
|
56
|
+
function getClassSet() {
|
|
57
|
+
return twPatcher.getClassSet({
|
|
58
|
+
basedir: tailwindcssBasedir
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
onLoad();
|
|
62
|
+
const loader = runtimeLoaderPath !== null && runtimeLoaderPath !== void 0 ? runtimeLoaderPath : path__default["default"].resolve(__dirname, './weapp-tw-runtime-loader.js');
|
|
63
|
+
const isExisted = fs__default["default"].existsSync(loader);
|
|
64
|
+
const WeappTwRuntimeAopLoader = {
|
|
65
|
+
loader,
|
|
66
|
+
options: {
|
|
67
|
+
getClassSet
|
|
68
|
+
},
|
|
69
|
+
ident: null,
|
|
70
|
+
type: null
|
|
71
|
+
};
|
|
72
|
+
compiler.hooks.compilation.tap(index.pluginName, (compilation) => {
|
|
73
|
+
compilation.hooks.normalModuleLoader.tap(index.pluginName, (loaderContext, module) => {
|
|
74
|
+
if (isExisted) {
|
|
75
|
+
const idx = module.loaders.findIndex((x) => x.loader.includes('postcss-loader'));
|
|
76
|
+
if (idx > -1) {
|
|
77
|
+
module.loaders.unshift(WeappTwRuntimeAopLoader);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
compiler.hooks.emit.tapPromise(index.pluginName, (compilation) => options.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
onStart();
|
|
84
|
+
debug('start');
|
|
85
|
+
for (const chunk of compilation.chunks) {
|
|
86
|
+
if (chunk.id && chunk.hash) {
|
|
87
|
+
cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const assets = compilation.assets;
|
|
91
|
+
const entries = Object.entries(assets);
|
|
92
|
+
const groupedEntries = defaults.getGroupedEntries(entries, this.options);
|
|
93
|
+
const runtimeSet = getClassSet();
|
|
94
|
+
setMangleRuntimeSet(runtimeSet);
|
|
95
|
+
debug('get runtimeSet, class count: %d', runtimeSet.size);
|
|
96
|
+
if (Array.isArray(groupedEntries.html)) {
|
|
97
|
+
let noCachedCount = 0;
|
|
98
|
+
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
99
|
+
const [file, originalSource] = groupedEntries.html[i];
|
|
100
|
+
const rawSource = originalSource.source().toString();
|
|
101
|
+
const hash = cache.computeHash(rawSource);
|
|
102
|
+
const cacheKey = file;
|
|
103
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
104
|
+
yield cache.process(cacheKey, () => {
|
|
105
|
+
const source = cache.get(cacheKey);
|
|
106
|
+
if (source) {
|
|
107
|
+
compilation.updateAsset(file, source);
|
|
108
|
+
debug('html cache hit: %s', file);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}, () => {
|
|
114
|
+
const wxml = templateHandler(rawSource, {
|
|
115
|
+
runtimeSet
|
|
116
|
+
});
|
|
117
|
+
const source = new webpackSources.ConcatSource(wxml);
|
|
118
|
+
compilation.updateAsset(file, source);
|
|
119
|
+
onUpdate(file, rawSource, wxml);
|
|
120
|
+
debug('html handle: %s', file);
|
|
121
|
+
noCachedCount++;
|
|
122
|
+
return {
|
|
123
|
+
key: cacheKey,
|
|
124
|
+
source
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
|
|
129
|
+
}
|
|
130
|
+
if (Array.isArray(groupedEntries.js)) {
|
|
131
|
+
let noCachedCount = 0;
|
|
132
|
+
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
133
|
+
const [file, originalSource] = groupedEntries.js[i];
|
|
134
|
+
const cacheKey = defaults.removeExt(file);
|
|
135
|
+
yield cache.process(cacheKey, () => {
|
|
136
|
+
const source = cache.get(cacheKey);
|
|
137
|
+
if (source) {
|
|
138
|
+
compilation.updateAsset(file, source);
|
|
139
|
+
debug('js cache hit: %s', file);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
}, () => {
|
|
145
|
+
const rawSource = originalSource.source().toString();
|
|
146
|
+
const mapFilename = file + '.map';
|
|
147
|
+
const hasMap = Boolean(assets[mapFilename]);
|
|
148
|
+
const { code, map } = jsHandler(rawSource, runtimeSet, {
|
|
149
|
+
generateMap: hasMap
|
|
150
|
+
});
|
|
151
|
+
const source = new webpackSources.ConcatSource(code);
|
|
152
|
+
compilation.updateAsset(file, source);
|
|
153
|
+
onUpdate(file, rawSource, code);
|
|
154
|
+
debug('js handle: %s', file);
|
|
155
|
+
noCachedCount++;
|
|
156
|
+
if (hasMap && map) {
|
|
157
|
+
const source = new webpackSources.RawSource(map.toString());
|
|
158
|
+
compilation.updateAsset(mapFilename, source);
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
key: cacheKey,
|
|
162
|
+
source
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
|
|
167
|
+
}
|
|
168
|
+
if (Array.isArray(groupedEntries.css)) {
|
|
169
|
+
let noCachedCount = 0;
|
|
170
|
+
for (let i = 0; i < groupedEntries.css.length; i++) {
|
|
171
|
+
const [file, originalSource] = groupedEntries.css[i];
|
|
172
|
+
const rawSource = originalSource.source().toString();
|
|
173
|
+
const hash = cache.computeHash(rawSource);
|
|
174
|
+
const cacheKey = file;
|
|
175
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
176
|
+
yield cache.process(cacheKey, () => {
|
|
177
|
+
const source = cache.get(cacheKey);
|
|
178
|
+
if (source) {
|
|
179
|
+
compilation.updateAsset(file, source);
|
|
180
|
+
debug('css cache hit: %s', file);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
const css = yield styleHandler(rawSource, {
|
|
187
|
+
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
188
|
+
});
|
|
189
|
+
const source = new webpackSources.ConcatSource(css);
|
|
190
|
+
compilation.updateAsset(file, source);
|
|
191
|
+
onUpdate(file, rawSource, css);
|
|
192
|
+
debug('css handle: %s', file);
|
|
193
|
+
noCachedCount++;
|
|
194
|
+
return {
|
|
195
|
+
key: cacheKey,
|
|
196
|
+
source
|
|
197
|
+
};
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
201
|
+
}
|
|
202
|
+
debug('end');
|
|
203
|
+
onEnd();
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
exports.UnifiedWebpackPluginV4 = UnifiedWebpackPluginV4;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-6YPFqoRJ.mjs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import { ConcatSource, RawSource } from 'webpack-sources';
|
|
5
|
+
import { b as pluginName } from './index-_74RBzwy.mjs';
|
|
6
|
+
import { g as getGroupedEntries, r as removeExt } from './defaults-TZpmwtzd.mjs';
|
|
7
|
+
import { c as createDebug } from './index-06BoOZig.mjs';
|
|
8
|
+
import 'magic-string';
|
|
9
|
+
import './replace.mjs';
|
|
10
|
+
import '@weapp-core/escape';
|
|
11
|
+
import '@ast-core/escape';
|
|
12
|
+
import './shared-0D5OOeXo.mjs';
|
|
13
|
+
import '@weapp-core/regex';
|
|
14
|
+
import '@babel/generator';
|
|
15
|
+
import '@babel/parser';
|
|
16
|
+
import '@babel/traverse';
|
|
17
|
+
import '@babel/types';
|
|
18
|
+
import 'htmlparser2';
|
|
19
|
+
import 'postcss';
|
|
20
|
+
import 'semver';
|
|
21
|
+
import 'tailwindcss-patch';
|
|
22
|
+
import '@tailwindcss-mangle/shared';
|
|
23
|
+
import 'lru-cache';
|
|
24
|
+
import 'md5';
|
|
25
|
+
import '@csstools/postcss-is-pseudo-class';
|
|
26
|
+
import 'postcss-rem-to-responsive-pixel';
|
|
27
|
+
import 'postcss-selector-parser';
|
|
28
|
+
import './defu-ms_ZBCiB.mjs';
|
|
29
|
+
import 'debug';
|
|
30
|
+
|
|
31
|
+
const debug = createDebug('processAssets: ');
|
|
32
|
+
class UnifiedWebpackPluginV4 {
|
|
33
|
+
constructor(options = {}) {
|
|
34
|
+
if (options.customReplaceDictionary === undefined) {
|
|
35
|
+
options.customReplaceDictionary = 'simple';
|
|
36
|
+
}
|
|
37
|
+
this.options = getOptions(options);
|
|
38
|
+
this.appType = this.options.appType;
|
|
39
|
+
}
|
|
40
|
+
apply(compiler) {
|
|
41
|
+
const { mainCssChunkMatcher, disabled, onLoad, onUpdate, onEnd, onStart, styleHandler, patch, templateHandler, jsHandler, setMangleRuntimeSet, runtimeLoaderPath, cache, tailwindcssBasedir } = this.options;
|
|
42
|
+
if (disabled) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
46
|
+
const twPatcher = createTailwindcssPatcher();
|
|
47
|
+
function getClassSet() {
|
|
48
|
+
return twPatcher.getClassSet({
|
|
49
|
+
basedir: tailwindcssBasedir
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
onLoad();
|
|
53
|
+
const loader = runtimeLoaderPath !== null && runtimeLoaderPath !== void 0 ? runtimeLoaderPath : path.resolve(__dirname, './weapp-tw-runtime-loader.js');
|
|
54
|
+
const isExisted = fs.existsSync(loader);
|
|
55
|
+
const WeappTwRuntimeAopLoader = {
|
|
56
|
+
loader,
|
|
57
|
+
options: {
|
|
58
|
+
getClassSet
|
|
59
|
+
},
|
|
60
|
+
ident: null,
|
|
61
|
+
type: null
|
|
62
|
+
};
|
|
63
|
+
compiler.hooks.compilation.tap(pluginName, (compilation) => {
|
|
64
|
+
compilation.hooks.normalModuleLoader.tap(pluginName, (loaderContext, module) => {
|
|
65
|
+
if (isExisted) {
|
|
66
|
+
const idx = module.loaders.findIndex((x) => x.loader.includes('postcss-loader'));
|
|
67
|
+
if (idx > -1) {
|
|
68
|
+
module.loaders.unshift(WeappTwRuntimeAopLoader);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
compiler.hooks.emit.tapPromise(pluginName, (compilation) => __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
onStart();
|
|
75
|
+
debug('start');
|
|
76
|
+
for (const chunk of compilation.chunks) {
|
|
77
|
+
if (chunk.id && chunk.hash) {
|
|
78
|
+
cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const assets = compilation.assets;
|
|
82
|
+
const entries = Object.entries(assets);
|
|
83
|
+
const groupedEntries = getGroupedEntries(entries, this.options);
|
|
84
|
+
const runtimeSet = getClassSet();
|
|
85
|
+
setMangleRuntimeSet(runtimeSet);
|
|
86
|
+
debug('get runtimeSet, class count: %d', runtimeSet.size);
|
|
87
|
+
if (Array.isArray(groupedEntries.html)) {
|
|
88
|
+
let noCachedCount = 0;
|
|
89
|
+
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
90
|
+
const [file, originalSource] = groupedEntries.html[i];
|
|
91
|
+
const rawSource = originalSource.source().toString();
|
|
92
|
+
const hash = cache.computeHash(rawSource);
|
|
93
|
+
const cacheKey = file;
|
|
94
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
95
|
+
yield cache.process(cacheKey, () => {
|
|
96
|
+
const source = cache.get(cacheKey);
|
|
97
|
+
if (source) {
|
|
98
|
+
compilation.updateAsset(file, source);
|
|
99
|
+
debug('html cache hit: %s', file);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}, () => {
|
|
105
|
+
const wxml = templateHandler(rawSource, {
|
|
106
|
+
runtimeSet
|
|
107
|
+
});
|
|
108
|
+
const source = new ConcatSource(wxml);
|
|
109
|
+
compilation.updateAsset(file, source);
|
|
110
|
+
onUpdate(file, rawSource, wxml);
|
|
111
|
+
debug('html handle: %s', file);
|
|
112
|
+
noCachedCount++;
|
|
113
|
+
return {
|
|
114
|
+
key: cacheKey,
|
|
115
|
+
source
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
|
|
120
|
+
}
|
|
121
|
+
if (Array.isArray(groupedEntries.js)) {
|
|
122
|
+
let noCachedCount = 0;
|
|
123
|
+
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
124
|
+
const [file, originalSource] = groupedEntries.js[i];
|
|
125
|
+
const cacheKey = removeExt(file);
|
|
126
|
+
yield cache.process(cacheKey, () => {
|
|
127
|
+
const source = cache.get(cacheKey);
|
|
128
|
+
if (source) {
|
|
129
|
+
compilation.updateAsset(file, source);
|
|
130
|
+
debug('js cache hit: %s', file);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}, () => {
|
|
136
|
+
const rawSource = originalSource.source().toString();
|
|
137
|
+
const mapFilename = file + '.map';
|
|
138
|
+
const hasMap = Boolean(assets[mapFilename]);
|
|
139
|
+
const { code, map } = jsHandler(rawSource, runtimeSet, {
|
|
140
|
+
generateMap: hasMap
|
|
141
|
+
});
|
|
142
|
+
const source = new ConcatSource(code);
|
|
143
|
+
compilation.updateAsset(file, source);
|
|
144
|
+
onUpdate(file, rawSource, code);
|
|
145
|
+
debug('js handle: %s', file);
|
|
146
|
+
noCachedCount++;
|
|
147
|
+
if (hasMap && map) {
|
|
148
|
+
const source = new RawSource(map.toString());
|
|
149
|
+
compilation.updateAsset(mapFilename, source);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
key: cacheKey,
|
|
153
|
+
source
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
|
|
158
|
+
}
|
|
159
|
+
if (Array.isArray(groupedEntries.css)) {
|
|
160
|
+
let noCachedCount = 0;
|
|
161
|
+
for (let i = 0; i < groupedEntries.css.length; i++) {
|
|
162
|
+
const [file, originalSource] = groupedEntries.css[i];
|
|
163
|
+
const rawSource = originalSource.source().toString();
|
|
164
|
+
const hash = cache.computeHash(rawSource);
|
|
165
|
+
const cacheKey = file;
|
|
166
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
167
|
+
yield cache.process(cacheKey, () => {
|
|
168
|
+
const source = cache.get(cacheKey);
|
|
169
|
+
if (source) {
|
|
170
|
+
compilation.updateAsset(file, source);
|
|
171
|
+
debug('css cache hit: %s', file);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
const css = yield styleHandler(rawSource, {
|
|
178
|
+
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
179
|
+
});
|
|
180
|
+
const source = new ConcatSource(css);
|
|
181
|
+
compilation.updateAsset(file, source);
|
|
182
|
+
onUpdate(file, rawSource, css);
|
|
183
|
+
debug('css handle: %s', file);
|
|
184
|
+
noCachedCount++;
|
|
185
|
+
return {
|
|
186
|
+
key: cacheKey,
|
|
187
|
+
source
|
|
188
|
+
};
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
192
|
+
}
|
|
193
|
+
debug('end');
|
|
194
|
+
onEnd();
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export { UnifiedWebpackPluginV4 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "把tailwindcss jit引擎,带给小程序开发者们! bring tailwindcss jit engine to miniprogram developers!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
"require": "./dist/webpack.js",
|
|
32
32
|
"import": "./dist/webpack.mjs"
|
|
33
33
|
},
|
|
34
|
+
"./webpack4": {
|
|
35
|
+
"types": "./dist/webpack4.d.ts",
|
|
36
|
+
"require": "./dist/webpack4.js",
|
|
37
|
+
"import": "./dist/webpack4.mjs"
|
|
38
|
+
},
|
|
34
39
|
"./core": {
|
|
35
40
|
"types": "./dist/core.d.ts",
|
|
36
41
|
"require": "./dist/core.js",
|
|
@@ -117,12 +122,12 @@
|
|
|
117
122
|
},
|
|
118
123
|
"homepage": "https://weapp-tw.icebreaker.top",
|
|
119
124
|
"devDependencies": {
|
|
120
|
-
"@babel/core": "^7.23.
|
|
125
|
+
"@babel/core": "^7.23.6",
|
|
121
126
|
"@icebreakers/cli": "0.1.1",
|
|
122
127
|
"@icebreakers/readme": "0.1.0",
|
|
123
128
|
"@rollup/plugin-alias": "^5.1.0",
|
|
124
129
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
125
|
-
"@rollup/plugin-json": "^6.0
|
|
130
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
126
131
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
127
132
|
"@rollup/plugin-terser": "^0.4.4",
|
|
128
133
|
"@rollup/plugin-typescript": "^11.1.5",
|
|
@@ -130,7 +135,7 @@
|
|
|
130
135
|
"@types/babel__generator": "^7.6.7",
|
|
131
136
|
"@types/babel__traverse": "^7.20.4",
|
|
132
137
|
"@types/debug": "^4.1.12",
|
|
133
|
-
"@types/diff": "^5.0.
|
|
138
|
+
"@types/diff": "^5.0.9",
|
|
134
139
|
"@types/fs-extra": "^11.0.4",
|
|
135
140
|
"@types/gulp": "^4.0.17",
|
|
136
141
|
"@types/gulp-postcss": "^8.0.6",
|
|
@@ -140,15 +145,17 @@
|
|
|
140
145
|
"@types/lodash": "^4.14.202",
|
|
141
146
|
"@types/md5": "^2.3.5",
|
|
142
147
|
"@types/micromatch": "^4.0.6",
|
|
143
|
-
"@types/node": "^20.10.
|
|
148
|
+
"@types/node": "^20.10.4",
|
|
144
149
|
"@types/semver": "^7.5.6",
|
|
145
150
|
"@types/vinyl": "^2.0.11",
|
|
146
151
|
"@types/webpack": "^5.28.5",
|
|
147
152
|
"@types/webpack-sources": "^3.2.3",
|
|
148
|
-
"@
|
|
153
|
+
"@types/webpack4": "npm:@types/webpack@4",
|
|
154
|
+
"@vitest/coverage-v8": "^1.0.4",
|
|
155
|
+
"@vitest/ui": "^1.0.4",
|
|
149
156
|
"autoprefixer": "^10.4.16",
|
|
150
157
|
"babel-loader": "^9.1.3",
|
|
151
|
-
"bumpp": "^9.2.
|
|
158
|
+
"bumpp": "^9.2.1",
|
|
152
159
|
"colorette": "^2.0.20",
|
|
153
160
|
"cross-env": "^7.0.3",
|
|
154
161
|
"css-loader": "^6.8.1",
|
|
@@ -158,13 +165,13 @@
|
|
|
158
165
|
"del": "^7.1.0",
|
|
159
166
|
"diff": "^5.1.0",
|
|
160
167
|
"domhandler": "^5.0.3",
|
|
161
|
-
"eslint": "8.
|
|
168
|
+
"eslint": "8.55.0",
|
|
162
169
|
"eslint-config-icebreaker": "^1.2.2",
|
|
163
|
-
"eslint-config-prettier": "^9.
|
|
170
|
+
"eslint-config-prettier": "^9.1.0",
|
|
164
171
|
"eslint-plugin-prettier": "^5.0.1",
|
|
165
172
|
"execa": "^7.2.0",
|
|
166
173
|
"fast-glob": "^3.3.2",
|
|
167
|
-
"fs-extra": "^11.
|
|
174
|
+
"fs-extra": "^11.2.0",
|
|
168
175
|
"gulp": "^4.0.2",
|
|
169
176
|
"gulp-postcss": "^9.0.1",
|
|
170
177
|
"html-loader": "^4.2.0",
|
|
@@ -174,34 +181,34 @@
|
|
|
174
181
|
"mini-css-extract-plugin": "^2.7.6",
|
|
175
182
|
"miniprogram-automator": "^0.12.1",
|
|
176
183
|
"pkg-types": "^1.0.3",
|
|
177
|
-
"postcss-load-config": "^
|
|
184
|
+
"postcss-load-config": "^5.0.2",
|
|
178
185
|
"postcss-loader": "^7.3.3",
|
|
179
|
-
"prettier": "^3.1.
|
|
186
|
+
"prettier": "^3.1.1",
|
|
180
187
|
"promisify-loader-runner": "^1.0.1",
|
|
181
|
-
"rollup": "^4.
|
|
182
|
-
"rollup-plugin-visualizer": "^5.
|
|
188
|
+
"rollup": "^4.9.0",
|
|
189
|
+
"rollup-plugin-visualizer": "^5.11.0",
|
|
183
190
|
"sass": "^1.69.5",
|
|
184
191
|
"style-loader": "^3.3.3",
|
|
185
|
-
"tailwindcss": "^3.3.
|
|
186
|
-
"ts-node": "^10.9.
|
|
187
|
-
"ts-patch": "^3.
|
|
192
|
+
"tailwindcss": "^3.3.6",
|
|
193
|
+
"ts-node": "^10.9.2",
|
|
194
|
+
"ts-patch": "^3.1.1",
|
|
188
195
|
"tsd": "^0.29.0",
|
|
189
196
|
"tslib": "^2.6.2",
|
|
190
|
-
"typescript": "^5.3.
|
|
197
|
+
"typescript": "^5.3.3",
|
|
191
198
|
"typescript-transform-paths": "^3.4.6",
|
|
192
199
|
"vinyl": "^3.0.0",
|
|
193
|
-
"vite": "^5.0.
|
|
194
|
-
"vitest": "^0.
|
|
200
|
+
"vite": "^5.0.9",
|
|
201
|
+
"vitest": "^1.0.4",
|
|
195
202
|
"weapp-tailwindcss-children": "^0.1.0",
|
|
196
203
|
"webpack": "^5.89.0",
|
|
197
204
|
"webpack-build-utils": "^0.0.7"
|
|
198
205
|
},
|
|
199
206
|
"dependencies": {
|
|
200
207
|
"@ast-core/escape": "^1.0.1",
|
|
201
|
-
"@babel/generator": "^7.23.
|
|
202
|
-
"@babel/parser": "^7.23.
|
|
203
|
-
"@babel/traverse": "^7.23.
|
|
204
|
-
"@babel/types": "^7.23.
|
|
208
|
+
"@babel/generator": "^7.23.5",
|
|
209
|
+
"@babel/parser": "^7.23.5",
|
|
210
|
+
"@babel/traverse": "^7.23.5",
|
|
211
|
+
"@babel/types": "^7.23.5",
|
|
205
212
|
"@csstools/postcss-is-pseudo-class": "^4.0.3",
|
|
206
213
|
"@tailwindcss-mangle/shared": "^2.2.2",
|
|
207
214
|
"@weapp-core/escape": "^2.0.0",
|
|
@@ -212,11 +219,12 @@
|
|
|
212
219
|
"lru-cache": "^10.1.0",
|
|
213
220
|
"magic-string": "^0.30.5",
|
|
214
221
|
"md5": "^2.3.0",
|
|
215
|
-
"postcss": "8.4.
|
|
222
|
+
"postcss": "8.4.32",
|
|
216
223
|
"postcss-rem-to-responsive-pixel": "^6.0.1",
|
|
217
224
|
"postcss-selector-parser": "^6.0.13",
|
|
218
225
|
"semver": "^7.5.4",
|
|
219
|
-
"tailwindcss-patch": "^2.2.2"
|
|
226
|
+
"tailwindcss-patch": "^2.2.2",
|
|
227
|
+
"webpack-sources": "^3.2.3"
|
|
220
228
|
},
|
|
221
229
|
"packageManager": "pnpm@8.10.2",
|
|
222
230
|
"engines": {
|
|
@@ -230,6 +238,7 @@
|
|
|
230
238
|
"dts": "tsc --emitDeclarationOnly -p tsconfig.dts.json",
|
|
231
239
|
"test": "npm run postinstall && vitest run",
|
|
232
240
|
"test:dev": "vitest",
|
|
241
|
+
"test:ui": "vitest --ui",
|
|
233
242
|
"vitest:coverage": "vitest run --coverage",
|
|
234
243
|
"e2e": "vitest run -c ./vitest.e2e.config.ts",
|
|
235
244
|
"e2e:dev": "vitest -c ./vitest.e2e.config.ts",
|