weapp-tailwindcss 3.7.0 → 3.8.0-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/README.md +1 -23
- package/dist/chunk-35CYTBPM.js +26 -0
- package/dist/chunk-6FNC3XMI.js +45 -0
- package/dist/chunk-6Z776ZWK.js +43 -0
- package/dist/chunk-75EWCRQW.mjs +13 -0
- package/dist/chunk-7J6ZENMS.js +216 -0
- package/dist/chunk-A2EDVNQK.mjs +173 -0
- package/dist/chunk-AB467PG7.mjs +43 -0
- package/dist/chunk-AXBFBHS2.mjs +45 -0
- package/dist/chunk-C7DFN4K3.js +152 -0
- package/dist/chunk-FYOOMUKL.js +115 -0
- package/dist/chunk-HBQASQKY.js +13 -0
- package/dist/chunk-JVPRWRPJ.mjs +115 -0
- package/dist/chunk-K7CL4YBQ.mjs +216 -0
- package/dist/chunk-KE7J6XFD.mjs +537 -0
- package/dist/chunk-LQN2VTMU.js +537 -0
- package/dist/chunk-MUJ65IQ3.mjs +26 -0
- package/dist/chunk-QJPVKPQS.js +1003 -0
- package/dist/chunk-RFNUATFD.js +24 -0
- package/dist/chunk-T4A3DCFN.mjs +152 -0
- package/dist/chunk-U7O2XXYR.mjs +24 -0
- package/dist/chunk-VFCTLSC3.mjs +1003 -0
- package/dist/chunk-VKSQ6BRD.mjs +27 -0
- package/dist/chunk-WMQLIT4T.js +173 -0
- package/dist/chunk-XSZXPWWL.js +27 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +23 -3400
- package/dist/cli.mjs +28 -3392
- package/dist/core.d.mts +27 -0
- package/dist/core.d.ts +23 -4
- package/dist/core.js +34 -56
- package/dist/core.mjs +36 -54
- package/dist/css-macro/postcss.d.mts +7 -0
- package/dist/css-macro/postcss.d.ts +5 -3
- package/dist/css-macro/postcss.js +54 -45
- package/dist/css-macro/postcss.mjs +54 -45
- package/dist/css-macro.d.mts +18 -0
- package/dist/css-macro.d.ts +18 -0
- package/dist/css-macro.js +40 -0
- package/dist/css-macro.mjs +38 -0
- package/dist/defaults.d.mts +16 -0
- package/dist/defaults.d.ts +16 -2
- package/dist/defaults.js +5 -9
- package/dist/defaults.mjs +8 -4
- package/dist/escape.d.mts +19 -0
- package/dist/escape.d.ts +19 -4
- package/dist/escape.js +11 -0
- package/dist/escape.mjs +11 -0
- package/dist/gulp.d.mts +26 -0
- package/dist/gulp.d.ts +26 -1
- package/dist/gulp.js +11 -36
- package/dist/gulp.mjs +14 -31
- package/dist/index-g4epDIUu.d.mts +534 -0
- package/dist/index-g4epDIUu.d.ts +534 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +22 -44
- package/dist/index.mjs +22 -34
- package/dist/postcss.d.mts +28 -0
- package/dist/postcss.d.ts +28 -1
- package/dist/postcss.js +9 -24
- package/dist/postcss.mjs +16 -8
- package/dist/replace.d.mts +22 -0
- package/dist/replace.d.ts +22 -3
- package/dist/replace.js +33 -50
- package/dist/replace.mjs +32 -25
- package/dist/shared-5ArEo9kL.d.mts +5 -0
- package/dist/shared-DI2Qz1ou.d.ts +5 -0
- package/dist/vite.d.mts +22 -0
- package/dist/vite.d.ts +22 -1
- package/dist/vite.js +11 -34
- package/dist/vite.mjs +14 -29
- package/dist/weapp-tw-runtime-loader.d.mts +7 -0
- package/dist/{bundlers/webpack/loaders/weapp-tw-runtime-loader.d.ts → weapp-tw-runtime-loader.d.ts} +4 -2
- package/dist/weapp-tw-runtime-loader.js +12 -12
- package/dist/weapp-tw-runtime-loader.mjs +12 -8
- package/dist/webpack.d.mts +26 -0
- package/dist/webpack.d.ts +26 -1
- package/dist/webpack.js +11 -35
- package/dist/webpack.mjs +14 -30
- package/dist/webpack4.d.mts +27 -0
- package/dist/webpack4.d.ts +27 -1
- package/dist/webpack4.js +204 -192
- package/dist/webpack4.mjs +210 -189
- package/package.json +26 -19
- package/dist/babel/index.d.ts +0 -5
- package/dist/bundlers/gulp/index.d.ts +0 -7
- package/dist/bundlers/vite/index.d.ts +0 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +0 -8
- package/dist/bundlers/webpack/index.d.ts +0 -1
- package/dist/cache/index.d.ts +0 -31
- package/dist/constants-CFM1J-h1.js +0 -42
- package/dist/constants-Dy2Dd3Fz.mjs +0 -36
- package/dist/constants.d.ts +0 -7
- package/dist/css-macro/constants.d.ts +0 -14
- package/dist/css-macro/index.d.ts +0 -15
- package/dist/css-macro/index.js +0 -36
- package/dist/css-macro/index.mjs +0 -30
- package/dist/debug/index.d.ts +0 -2
- package/dist/defaults-5A8JI2hW.mjs +0 -139
- package/dist/defaults-CdqzSWsR.js +0 -145
- package/dist/defu-Cdz2PomB.js +0 -60
- package/dist/defu-n46TJT6t.mjs +0 -57
- package/dist/env.d.ts +0 -2
- package/dist/extractors/split.d.ts +0 -3
- package/dist/index-BEIjgKpF.mjs +0 -11
- package/dist/index-BF8k8rHr.mjs +0 -517
- package/dist/index-BTXkyxen.js +0 -136
- package/dist/index-C0QsyqD6.mjs +0 -134
- package/dist/index-ClSBbhnm.js +0 -130
- package/dist/index-DoMb0-xW.mjs +0 -124
- package/dist/index-HC-Qkn0i.js +0 -17
- package/dist/index-h2-ZMO3S.js +0 -530
- package/dist/init.d.ts +0 -34
- package/dist/js/ast-grep.d.ts +0 -1
- package/dist/js/babel.d.ts +0 -3
- package/dist/js/handlers.d.ts +0 -11
- package/dist/js/index.d.ts +0 -7
- package/dist/logger.d.ts +0 -1
- package/dist/mangle/index.d.ts +0 -8
- package/dist/npm.d.ts +0 -22
- package/dist/options-Bv-1GQJY.js +0 -891
- package/dist/options-yXyCFCtr.mjs +0 -858
- package/dist/options.d.ts +0 -2
- package/dist/postcss/cssVars.d.ts +0 -5
- package/dist/postcss/index.d.ts +0 -4
- package/dist/postcss/mp.d.ts +0 -8
- package/dist/postcss/plugins/ctx.d.ts +0 -6
- package/dist/postcss/plugins/index.d.ts +0 -7
- package/dist/postcss/plugins/post.d.ts +0 -5
- package/dist/postcss/plugins/pre.d.ts +0 -5
- package/dist/postcss/preflight.d.ts +0 -3
- package/dist/postcss/selectorParser.d.ts +0 -6
- package/dist/postcss/shared.d.ts +0 -3
- package/dist/postcss/symbols.d.ts +0 -1
- package/dist/reg.d.ts +0 -1
- package/dist/shared-COWjpokr.mjs +0 -25
- package/dist/shared-r_GpWheO.js +0 -28
- package/dist/tailwindcss/patcher.d.ts +0 -3
- package/dist/types.d.ts +0 -165
- package/dist/utils.d.ts +0 -18
- package/dist/v5-DwFXG7m_.js +0 -181
- package/dist/v5-N5BYJ5JY.mjs +0 -174
- package/dist/wxml/Tokenizer.d.ts +0 -31
- package/dist/wxml/index.d.ts +0 -2
- package/dist/wxml/shared.d.ts +0 -2
- package/dist/wxml/utils.d.ts +0 -10
package/dist/webpack.d.ts
CHANGED
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import { Compiler } from 'webpack';
|
|
2
|
+
import { o as IBaseWebpackPlugin, m as InternalUserDefinedOptions, A as AppType, U as UserDefinedOptions } from './index-g4epDIUu.js';
|
|
3
|
+
import '@babel/generator';
|
|
4
|
+
import '@babel/parser';
|
|
5
|
+
import 'magic-string';
|
|
6
|
+
import 'postcss';
|
|
7
|
+
import 'tailwindcss-patch';
|
|
8
|
+
import 'node:buffer';
|
|
9
|
+
import 'lru-cache';
|
|
10
|
+
import '@tailwindcss-mangle/shared';
|
|
11
|
+
import 'postcss-load-config';
|
|
12
|
+
import 'postcss-rem-to-responsive-pixel';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @name UnifiedWebpackPluginV5
|
|
16
|
+
* @description webpack5 核心转义插件
|
|
17
|
+
* @link https://tw.icebreaker.top/docs/intro
|
|
18
|
+
*/
|
|
19
|
+
declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
|
|
20
|
+
options: InternalUserDefinedOptions;
|
|
21
|
+
appType?: AppType;
|
|
22
|
+
constructor(options?: UserDefinedOptions);
|
|
23
|
+
apply(compiler: Compiler): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { UnifiedWebpackPluginV5 };
|
package/dist/webpack.js
CHANGED
|
@@ -1,38 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _chunk7J6ZENMSjs = require('./chunk-7J6ZENMS.js');
|
|
4
|
+
require('./chunk-HBQASQKY.js');
|
|
5
|
+
require('./chunk-QJPVKPQS.js');
|
|
6
|
+
require('./chunk-FYOOMUKL.js');
|
|
7
|
+
require('./chunk-35CYTBPM.js');
|
|
8
|
+
require('./chunk-LQN2VTMU.js');
|
|
9
|
+
require('./chunk-RFNUATFD.js');
|
|
10
|
+
require('./chunk-XSZXPWWL.js');
|
|
11
|
+
require('./chunk-6FNC3XMI.js');
|
|
4
12
|
|
|
5
|
-
var v5 = require('./v5-DwFXG7m_.js');
|
|
6
|
-
require('./options-Bv-1GQJY.js');
|
|
7
|
-
require('lru-cache');
|
|
8
|
-
require('md5');
|
|
9
|
-
require('./defaults-CdqzSWsR.js');
|
|
10
|
-
require('@ast-core/escape');
|
|
11
|
-
require('@weapp-core/escape');
|
|
12
|
-
require('./defu-Cdz2PomB.js');
|
|
13
|
-
require('magic-string');
|
|
14
|
-
require('@babel/generator');
|
|
15
|
-
require('@babel/traverse');
|
|
16
|
-
require('@babel/parser');
|
|
17
|
-
require('consola');
|
|
18
|
-
require('@weapp-core/regex');
|
|
19
|
-
require('./replace.js');
|
|
20
|
-
require('./shared-r_GpWheO.js');
|
|
21
|
-
require('@tailwindcss-mangle/shared');
|
|
22
|
-
require('postcss');
|
|
23
|
-
require('./index-h2-ZMO3S.js');
|
|
24
|
-
require('@csstools/postcss-is-pseudo-class');
|
|
25
|
-
require('postcss-rem-to-responsive-pixel');
|
|
26
|
-
require('postcss-selector-parser');
|
|
27
|
-
require('node:path');
|
|
28
|
-
require('node:process');
|
|
29
|
-
require('tailwindcss-patch');
|
|
30
|
-
require('@babel/types');
|
|
31
|
-
require('htmlparser2');
|
|
32
|
-
require('node:fs');
|
|
33
|
-
require('./index-HC-Qkn0i.js');
|
|
34
|
-
require('debug');
|
|
35
13
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
exports.UnifiedWebpackPluginV5 = v5.UnifiedWebpackPluginV5;
|
|
14
|
+
exports.UnifiedWebpackPluginV5 = _chunk7J6ZENMSjs.UnifiedWebpackPluginV5;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import './replace.mjs';
|
|
16
|
-
import './shared-COWjpokr.mjs';
|
|
17
|
-
import '@tailwindcss-mangle/shared';
|
|
18
|
-
import 'postcss';
|
|
19
|
-
import './index-BF8k8rHr.mjs';
|
|
20
|
-
import '@csstools/postcss-is-pseudo-class';
|
|
21
|
-
import 'postcss-rem-to-responsive-pixel';
|
|
22
|
-
import 'postcss-selector-parser';
|
|
23
|
-
import 'node:path';
|
|
24
|
-
import 'node:process';
|
|
25
|
-
import 'tailwindcss-patch';
|
|
26
|
-
import '@babel/types';
|
|
27
|
-
import 'htmlparser2';
|
|
28
|
-
import 'node:fs';
|
|
29
|
-
import './index-BEIjgKpF.mjs';
|
|
30
|
-
import 'debug';
|
|
1
|
+
import {
|
|
2
|
+
UnifiedWebpackPluginV5
|
|
3
|
+
} from "./chunk-K7CL4YBQ.mjs";
|
|
4
|
+
import "./chunk-75EWCRQW.mjs";
|
|
5
|
+
import "./chunk-VFCTLSC3.mjs";
|
|
6
|
+
import "./chunk-JVPRWRPJ.mjs";
|
|
7
|
+
import "./chunk-MUJ65IQ3.mjs";
|
|
8
|
+
import "./chunk-KE7J6XFD.mjs";
|
|
9
|
+
import "./chunk-U7O2XXYR.mjs";
|
|
10
|
+
import "./chunk-VKSQ6BRD.mjs";
|
|
11
|
+
import "./chunk-AXBFBHS2.mjs";
|
|
12
|
+
export {
|
|
13
|
+
UnifiedWebpackPluginV5
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Compiler } from 'webpack4';
|
|
2
|
+
import { o as IBaseWebpackPlugin, m as InternalUserDefinedOptions, A as AppType, U as UserDefinedOptions } from './index-g4epDIUu.mjs';
|
|
3
|
+
import '@babel/generator';
|
|
4
|
+
import '@babel/parser';
|
|
5
|
+
import 'magic-string';
|
|
6
|
+
import 'postcss';
|
|
7
|
+
import 'tailwindcss-patch';
|
|
8
|
+
import 'node:buffer';
|
|
9
|
+
import 'webpack';
|
|
10
|
+
import 'lru-cache';
|
|
11
|
+
import '@tailwindcss-mangle/shared';
|
|
12
|
+
import 'postcss-load-config';
|
|
13
|
+
import 'postcss-rem-to-responsive-pixel';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name UnifiedWebpackPluginV4
|
|
17
|
+
* @description webpack4 核心转义插件
|
|
18
|
+
* @link https://tw.icebreaker.top/docs/intro
|
|
19
|
+
*/
|
|
20
|
+
declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
|
|
21
|
+
options: InternalUserDefinedOptions;
|
|
22
|
+
appType?: AppType;
|
|
23
|
+
constructor(options?: UserDefinedOptions);
|
|
24
|
+
apply(compiler: Compiler): void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { UnifiedWebpackPluginV4 };
|
package/dist/webpack4.d.ts
CHANGED
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { Compiler } from 'webpack4';
|
|
2
|
+
import { o as IBaseWebpackPlugin, m as InternalUserDefinedOptions, A as AppType, U as UserDefinedOptions } from './index-g4epDIUu.js';
|
|
3
|
+
import '@babel/generator';
|
|
4
|
+
import '@babel/parser';
|
|
5
|
+
import 'magic-string';
|
|
6
|
+
import 'postcss';
|
|
7
|
+
import 'tailwindcss-patch';
|
|
8
|
+
import 'node:buffer';
|
|
9
|
+
import 'webpack';
|
|
10
|
+
import 'lru-cache';
|
|
11
|
+
import '@tailwindcss-mangle/shared';
|
|
12
|
+
import 'postcss-load-config';
|
|
13
|
+
import 'postcss-rem-to-responsive-pixel';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @name UnifiedWebpackPluginV4
|
|
17
|
+
* @description webpack4 核心转义插件
|
|
18
|
+
* @link https://tw.icebreaker.top/docs/intro
|
|
19
|
+
*/
|
|
20
|
+
declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
|
|
21
|
+
options: InternalUserDefinedOptions;
|
|
22
|
+
appType?: AppType;
|
|
23
|
+
constructor(options?: UserDefinedOptions);
|
|
24
|
+
apply(compiler: Compiler): void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { UnifiedWebpackPluginV4 };
|
package/dist/webpack4.js
CHANGED
|
@@ -1,203 +1,215 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
4
4
|
|
|
5
|
-
var options = require('./options-Bv-1GQJY.js');
|
|
6
|
-
var fs = require('node:fs');
|
|
7
|
-
var path = require('node:path');
|
|
8
|
-
var webpackSources = require('webpack-sources');
|
|
9
|
-
var index = require('./index-h2-ZMO3S.js');
|
|
10
|
-
var index$1 = require('./index-HC-Qkn0i.js');
|
|
11
|
-
var defaults = require('./defaults-CdqzSWsR.js');
|
|
12
|
-
require('lru-cache');
|
|
13
|
-
require('md5');
|
|
14
|
-
require('magic-string');
|
|
15
|
-
require('@babel/generator');
|
|
16
|
-
require('@babel/traverse');
|
|
17
|
-
require('@babel/parser');
|
|
18
|
-
require('@ast-core/escape');
|
|
19
|
-
require('@weapp-core/escape');
|
|
20
|
-
require('consola');
|
|
21
|
-
require('@weapp-core/regex');
|
|
22
|
-
require('./replace.js');
|
|
23
|
-
require('./shared-r_GpWheO.js');
|
|
24
|
-
require('@tailwindcss-mangle/shared');
|
|
25
|
-
require('postcss');
|
|
26
|
-
require('node:process');
|
|
27
|
-
require('tailwindcss-patch');
|
|
28
|
-
require('@babel/types');
|
|
29
|
-
require('htmlparser2');
|
|
30
|
-
require('@csstools/postcss-is-pseudo-class');
|
|
31
|
-
require('postcss-rem-to-responsive-pixel');
|
|
32
|
-
require('postcss-selector-parser');
|
|
33
|
-
require('debug');
|
|
34
|
-
require('./defu-Cdz2PomB.js');
|
|
35
5
|
|
|
36
|
-
|
|
6
|
+
var _chunkQJPVKPQSjs = require('./chunk-QJPVKPQS.js');
|
|
7
|
+
require('./chunk-FYOOMUKL.js');
|
|
37
8
|
|
|
38
|
-
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
39
|
-
var path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
40
9
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
10
|
+
|
|
11
|
+
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkLQN2VTMUjs = require('./chunk-LQN2VTMU.js');
|
|
15
|
+
require('./chunk-RFNUATFD.js');
|
|
16
|
+
require('./chunk-XSZXPWWL.js');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
20
|
+
|
|
21
|
+
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
22
|
+
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
23
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
24
|
+
var _webpacksources = require('webpack-sources');
|
|
25
|
+
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
26
|
+
var UnifiedWebpackPluginV4 = class {
|
|
27
|
+
constructor(options = {}) {
|
|
28
|
+
this.options = _chunkQJPVKPQSjs.getOptions.call(void 0, options);
|
|
29
|
+
this.appType = this.options.appType;
|
|
30
|
+
}
|
|
31
|
+
apply(compiler) {
|
|
32
|
+
const {
|
|
33
|
+
mainCssChunkMatcher,
|
|
34
|
+
disabled,
|
|
35
|
+
onLoad,
|
|
36
|
+
onUpdate,
|
|
37
|
+
onEnd,
|
|
38
|
+
onStart,
|
|
39
|
+
styleHandler,
|
|
40
|
+
patch,
|
|
41
|
+
templateHandler,
|
|
42
|
+
jsHandler,
|
|
43
|
+
setMangleRuntimeSet,
|
|
44
|
+
runtimeLoaderPath,
|
|
45
|
+
cache,
|
|
46
|
+
twPatcher
|
|
47
|
+
} = this.options;
|
|
48
|
+
if (disabled) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
patch == null ? void 0 : patch();
|
|
52
|
+
function getClassSet() {
|
|
53
|
+
return twPatcher.getClassSet();
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
onLoad();
|
|
56
|
+
const loader = runtimeLoaderPath != null ? runtimeLoaderPath : _path2.default.resolve(__dirname, "./weapp-tw-runtime-loader.js");
|
|
57
|
+
const isExisted = _fs2.default.existsSync(loader);
|
|
58
|
+
const WeappTwRuntimeAopLoader = {
|
|
59
|
+
loader,
|
|
60
|
+
options: {
|
|
61
|
+
getClassSet
|
|
62
|
+
},
|
|
63
|
+
ident: null,
|
|
64
|
+
type: null
|
|
65
|
+
};
|
|
66
|
+
compiler.hooks.compilation.tap(_chunkLQN2VTMUjs.pluginName, (compilation) => {
|
|
67
|
+
compilation.hooks.normalModuleLoader.tap(_chunkLQN2VTMUjs.pluginName, (_loaderContext, module) => {
|
|
68
|
+
if (isExisted) {
|
|
69
|
+
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
70
|
+
if (idx > -1) {
|
|
71
|
+
module.loaders.unshift(WeappTwRuntimeAopLoader);
|
|
72
|
+
}
|
|
51
73
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
compiler.hooks.emit.tapPromise(_chunkLQN2VTMUjs.pluginName, (compilation) => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
77
|
+
onStart();
|
|
78
|
+
debug("start");
|
|
79
|
+
for (const chunk of compilation.chunks) {
|
|
80
|
+
if (chunk.id && chunk.hash) {
|
|
81
|
+
cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
55
82
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
}
|
|
84
|
+
const assets = compilation.assets;
|
|
85
|
+
const entries = Object.entries(assets);
|
|
86
|
+
const groupedEntries = _chunk35CYTBPMjs.getGroupedEntries.call(void 0, entries, this.options);
|
|
87
|
+
const runtimeSet = getClassSet();
|
|
88
|
+
setMangleRuntimeSet(runtimeSet);
|
|
89
|
+
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
90
|
+
if (Array.isArray(groupedEntries.html)) {
|
|
91
|
+
let noCachedCount = 0;
|
|
92
|
+
for (let i = 0; i < groupedEntries.html.length; i++) {
|
|
93
|
+
const [file, originalSource] = groupedEntries.html[i];
|
|
94
|
+
const rawSource = originalSource.source().toString();
|
|
95
|
+
const hash = cache.computeHash(rawSource);
|
|
96
|
+
const cacheKey = file;
|
|
97
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
98
|
+
yield cache.process(
|
|
99
|
+
cacheKey,
|
|
100
|
+
() => {
|
|
101
|
+
const source = cache.get(cacheKey);
|
|
102
|
+
if (source) {
|
|
103
|
+
compilation.updateAsset(file, source);
|
|
104
|
+
debug("html cache hit: %s", file);
|
|
105
|
+
} else {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
63
108
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const cacheKey = file;
|
|
170
|
-
cache.calcHashValueChanged(cacheKey, hash);
|
|
171
|
-
yield cache.process(cacheKey, () => {
|
|
172
|
-
const source = cache.get(cacheKey);
|
|
173
|
-
if (source) {
|
|
174
|
-
compilation.updateAsset(file, source);
|
|
175
|
-
debug('css cache hit: %s', file);
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
181
|
-
const { css } = yield styleHandler(rawSource, {
|
|
182
|
-
isMainChunk: mainCssChunkMatcher(file, this.appType),
|
|
183
|
-
});
|
|
184
|
-
const source = new webpackSources.ConcatSource(css);
|
|
185
|
-
compilation.updateAsset(file, source);
|
|
186
|
-
onUpdate(file, rawSource, css);
|
|
187
|
-
debug('css handle: %s', file);
|
|
188
|
-
noCachedCount++;
|
|
189
|
-
return {
|
|
190
|
-
key: cacheKey,
|
|
191
|
-
source,
|
|
192
|
-
};
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
debug('css handle finish, total: %d, no-cached: %d', groupedEntries.css.length, noCachedCount);
|
|
196
|
-
}
|
|
197
|
-
debug('end');
|
|
198
|
-
onEnd();
|
|
199
|
-
}));
|
|
200
|
-
}
|
|
201
|
-
}
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
111
|
+
const wxml = yield templateHandler(rawSource, {
|
|
112
|
+
runtimeSet
|
|
113
|
+
});
|
|
114
|
+
const source = new (0, _webpacksources.ConcatSource)(wxml);
|
|
115
|
+
compilation.updateAsset(file, source);
|
|
116
|
+
onUpdate(file, rawSource, wxml);
|
|
117
|
+
debug("html handle: %s", file);
|
|
118
|
+
noCachedCount++;
|
|
119
|
+
return {
|
|
120
|
+
key: cacheKey,
|
|
121
|
+
source
|
|
122
|
+
};
|
|
123
|
+
})
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
debug("html handle finish, total: %d, no-cached: %d", groupedEntries.html.length, noCachedCount);
|
|
127
|
+
}
|
|
128
|
+
if (Array.isArray(groupedEntries.js)) {
|
|
129
|
+
let noCachedCount = 0;
|
|
130
|
+
for (let i = 0; i < groupedEntries.js.length; i++) {
|
|
131
|
+
const [file, originalSource] = groupedEntries.js[i];
|
|
132
|
+
const cacheKey = _chunk35CYTBPMjs.removeExt.call(void 0, file);
|
|
133
|
+
yield cache.process(
|
|
134
|
+
cacheKey,
|
|
135
|
+
() => {
|
|
136
|
+
const source = cache.get(cacheKey);
|
|
137
|
+
if (source) {
|
|
138
|
+
compilation.updateAsset(file, source);
|
|
139
|
+
debug("js cache hit: %s", file);
|
|
140
|
+
} else {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
146
|
+
const rawSource = originalSource.source().toString();
|
|
147
|
+
const mapFilename = `${file}.map`;
|
|
148
|
+
const hasMap = Boolean(assets[mapFilename]);
|
|
149
|
+
const { code, map } = yield jsHandler(rawSource, runtimeSet, {
|
|
150
|
+
generateMap: hasMap
|
|
151
|
+
});
|
|
152
|
+
const source = new (0, _webpacksources.ConcatSource)(code);
|
|
153
|
+
compilation.updateAsset(file, source);
|
|
154
|
+
onUpdate(file, rawSource, code);
|
|
155
|
+
debug("js handle: %s", file);
|
|
156
|
+
noCachedCount++;
|
|
157
|
+
if (hasMap && map) {
|
|
158
|
+
const source2 = new (0, _webpacksources.RawSource)(map.toString());
|
|
159
|
+
compilation.updateAsset(mapFilename, source2);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
key: cacheKey,
|
|
163
|
+
source
|
|
164
|
+
};
|
|
165
|
+
})
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
debug("js handle finish, total: %d, no-cached: %d", groupedEntries.js.length, noCachedCount);
|
|
169
|
+
}
|
|
170
|
+
if (Array.isArray(groupedEntries.css)) {
|
|
171
|
+
let noCachedCount = 0;
|
|
172
|
+
for (let i = 0; i < groupedEntries.css.length; i++) {
|
|
173
|
+
const [file, originalSource] = groupedEntries.css[i];
|
|
174
|
+
const rawSource = originalSource.source().toString();
|
|
175
|
+
const hash = cache.computeHash(rawSource);
|
|
176
|
+
const cacheKey = file;
|
|
177
|
+
cache.calcHashValueChanged(cacheKey, hash);
|
|
178
|
+
yield cache.process(
|
|
179
|
+
cacheKey,
|
|
180
|
+
() => {
|
|
181
|
+
const source = cache.get(cacheKey);
|
|
182
|
+
if (source) {
|
|
183
|
+
compilation.updateAsset(file, source);
|
|
184
|
+
debug("css cache hit: %s", file);
|
|
185
|
+
} else {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
// @ts-ignore
|
|
190
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
191
|
+
const { css } = yield styleHandler(rawSource, {
|
|
192
|
+
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
193
|
+
});
|
|
194
|
+
const source = new (0, _webpacksources.ConcatSource)(css);
|
|
195
|
+
compilation.updateAsset(file, source);
|
|
196
|
+
onUpdate(file, rawSource, css);
|
|
197
|
+
debug("css handle: %s", file);
|
|
198
|
+
noCachedCount++;
|
|
199
|
+
return {
|
|
200
|
+
key: cacheKey,
|
|
201
|
+
source
|
|
202
|
+
};
|
|
203
|
+
})
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
debug("css handle finish, total: %d, no-cached: %d", groupedEntries.css.length, noCachedCount);
|
|
207
|
+
}
|
|
208
|
+
debug("end");
|
|
209
|
+
onEnd();
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
202
214
|
|
|
203
215
|
exports.UnifiedWebpackPluginV4 = UnifiedWebpackPluginV4;
|