weapp-tailwindcss 3.8.0-alpha.2 → 4.0.0-alpha.11
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-R3QJNUYU.js → chunk-6FNC3XMI.js} +1 -13
- package/dist/{chunk-FSYVGTJO.mjs → chunk-AXBFBHS2.mjs} +0 -12
- package/dist/{chunk-FQGZYB5X.mjs → chunk-CRIVJETU.mjs} +12 -13
- package/dist/{chunk-7BX3PGSW.mjs → chunk-F23L6ZME.mjs} +6 -6
- package/dist/{chunk-BY4T6WET.js → chunk-GHLS2DGY.js} +16 -17
- package/dist/{chunk-KQ4TG7V3.js → chunk-GX4O2YZI.js} +13 -13
- package/dist/{chunk-WX3XJ7PY.js → chunk-KVKGWZDD.js} +18 -19
- package/dist/{chunk-U7O2XXYR.mjs → chunk-PCBSAFQF.mjs} +2 -2
- package/dist/{chunk-IS6WLJ6U.mjs → chunk-PCLP6Y32.mjs} +46 -45
- package/dist/{chunk-Y4JDXXJ2.mjs → chunk-RHTRRSP3.mjs} +4 -4
- package/dist/{chunk-SLGPM54R.js → chunk-UDT6MZJ7.js} +63 -62
- package/dist/{chunk-RFNUATFD.js → chunk-WGQLZ5K4.js} +1 -1
- package/dist/{chunk-WNZKXLOB.mjs → chunk-XW3PPBN2.mjs} +12 -13
- package/dist/{chunk-NXBCP4JC.js → chunk-YUXG2EJF.js} +3 -3
- package/dist/cli.js +10 -10
- package/dist/cli.mjs +8 -8
- package/dist/core.d.mts +2 -3
- package/dist/core.d.ts +2 -3
- package/dist/core.js +12 -11
- package/dist/core.mjs +13 -12
- 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.d.mts +2 -3
- package/dist/defaults.d.ts +2 -3
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/escape.d.mts +2 -3
- package/dist/escape.d.ts +2 -3
- package/dist/escape.js +3 -3
- package/dist/escape.mjs +2 -2
- package/dist/gulp.d.mts +2 -3
- package/dist/gulp.d.ts +2 -3
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/index.d.mts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +9 -9
- package/dist/index.mjs +8 -8
- package/dist/types.d.mts +151 -24
- package/dist/types.d.ts +151 -24
- package/dist/vite.d.mts +3 -4
- package/dist/vite.d.ts +3 -4
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +6 -6
- package/dist/weapp-tw-runtime-loader.js +1 -3
- package/dist/webpack.d.mts +3 -4
- package/dist/webpack.d.ts +3 -4
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.d.mts +3 -4
- package/dist/webpack4.d.ts +3 -4
- package/dist/webpack4.js +19 -20
- package/dist/webpack4.mjs +14 -15
- package/package.json +11 -16
- package/dist/weapp-tw-runtime-loader.d.mts +0 -7
- package/dist/weapp-tw-runtime-loader.d.ts +0 -7
- package/dist/weapp-tw-runtime-loader.mjs +0 -14
- /package/dist/{chunk-L7PW3J3N.mjs → chunk-HL6Y5PYZ.mjs} +0 -0
- /package/dist/{chunk-EHEK77RO.js → chunk-N62XM3T3.js} +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -19,15 +17,6 @@ var __spreadValues = (a, b) => {
|
|
|
19
17
|
return a;
|
|
20
18
|
};
|
|
21
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
for (let key of __getOwnPropNames(from))
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
-
}
|
|
28
|
-
return to;
|
|
29
|
-
};
|
|
30
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
31
20
|
var __async = (__this, __arguments, generator) => {
|
|
32
21
|
return new Promise((resolve, reject) => {
|
|
33
22
|
var fulfilled = (value) => {
|
|
@@ -53,5 +42,4 @@ var __async = (__this, __arguments, generator) => {
|
|
|
53
42
|
|
|
54
43
|
|
|
55
44
|
|
|
56
|
-
|
|
57
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__reExport = __reExport; exports.__async = __async;
|
|
45
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__async = __async;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -19,15 +17,6 @@ var __spreadValues = (a, b) => {
|
|
|
19
17
|
return a;
|
|
20
18
|
};
|
|
21
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
for (let key of __getOwnPropNames(from))
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
-
}
|
|
28
|
-
return to;
|
|
29
|
-
};
|
|
30
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
31
20
|
var __async = (__this, __arguments, generator) => {
|
|
32
21
|
return new Promise((resolve, reject) => {
|
|
33
22
|
var fulfilled = (value) => {
|
|
@@ -52,6 +41,5 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
41
|
export {
|
|
53
42
|
__spreadValues,
|
|
54
43
|
__spreadProps,
|
|
55
|
-
__reExport,
|
|
56
44
|
__async
|
|
57
45
|
};
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "./chunk-75EWCRQW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
pluginName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HL6Y5PYZ.mjs";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
getCompilerContext
|
|
9
|
+
} from "./chunk-PCLP6Y32.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getGroupedEntries,
|
|
12
12
|
removeExt
|
|
13
13
|
} from "./chunk-MUJ65IQ3.mjs";
|
|
14
14
|
import {
|
|
15
15
|
__async
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
17
17
|
|
|
18
18
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
19
19
|
import fs from "node:fs";
|
|
@@ -21,7 +21,7 @@ import path from "node:path";
|
|
|
21
21
|
var debug = createDebug();
|
|
22
22
|
var UnifiedWebpackPluginV5 = class {
|
|
23
23
|
constructor(options = {}) {
|
|
24
|
-
this.options =
|
|
24
|
+
this.options = getCompilerContext(options);
|
|
25
25
|
this.appType = this.options.appType;
|
|
26
26
|
}
|
|
27
27
|
apply(compiler) {
|
|
@@ -33,7 +33,6 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
33
33
|
onEnd,
|
|
34
34
|
onStart,
|
|
35
35
|
styleHandler,
|
|
36
|
-
patch,
|
|
37
36
|
templateHandler,
|
|
38
37
|
jsHandler,
|
|
39
38
|
setMangleRuntimeSet,
|
|
@@ -44,7 +43,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
44
43
|
if (disabled) {
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
|
-
patch
|
|
46
|
+
twPatcher.patch();
|
|
48
47
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
49
48
|
const { ConcatSource, RawSource } = sources;
|
|
50
49
|
function getClassSet() {
|
|
@@ -90,8 +89,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
90
89
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
91
90
|
if (Array.isArray(groupedEntries.html)) {
|
|
92
91
|
let noCachedCount = 0;
|
|
93
|
-
for (
|
|
94
|
-
const [file, originalSource] =
|
|
92
|
+
for (const element of groupedEntries.html) {
|
|
93
|
+
const [file, originalSource] = element;
|
|
95
94
|
const rawSource = originalSource.source().toString();
|
|
96
95
|
const hash = cache.computeHash(rawSource);
|
|
97
96
|
const cacheKey = file;
|
|
@@ -127,8 +126,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
127
126
|
}
|
|
128
127
|
if (Array.isArray(groupedEntries.js)) {
|
|
129
128
|
let noCachedCount = 0;
|
|
130
|
-
for (
|
|
131
|
-
const [file, originalSource] =
|
|
129
|
+
for (const element of groupedEntries.js) {
|
|
130
|
+
const [file, originalSource] = element;
|
|
132
131
|
const cacheKey = removeExt(file);
|
|
133
132
|
yield cache.process(
|
|
134
133
|
cacheKey,
|
|
@@ -168,8 +167,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
168
167
|
}
|
|
169
168
|
if (Array.isArray(groupedEntries.css)) {
|
|
170
169
|
let noCachedCount = 0;
|
|
171
|
-
for (
|
|
172
|
-
const [file, originalSource] =
|
|
170
|
+
for (const element of groupedEntries.css) {
|
|
171
|
+
const [file, originalSource] = element;
|
|
173
172
|
const rawSource = originalSource.source().toString();
|
|
174
173
|
const hash = cache.computeHash(rawSource);
|
|
175
174
|
const cacheKey = file;
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createDebug
|
|
3
3
|
} from "./chunk-75EWCRQW.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
getCompilerContext
|
|
6
|
+
} from "./chunk-PCLP6Y32.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async,
|
|
9
9
|
__spreadValues
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AXBFBHS2.mjs";
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
import { Buffer } from "node:buffer";
|
|
@@ -15,10 +15,10 @@ import stream from "node:stream";
|
|
|
15
15
|
var debug = createDebug();
|
|
16
16
|
var Transform = stream.Transform;
|
|
17
17
|
function createPlugins(options = {}) {
|
|
18
|
-
const opts =
|
|
19
|
-
const { templateHandler, styleHandler,
|
|
18
|
+
const opts = getCompilerContext(options);
|
|
19
|
+
const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
|
|
20
20
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
21
|
-
patch
|
|
21
|
+
twPatcher.patch();
|
|
22
22
|
function transformWxss(options2 = {}) {
|
|
23
23
|
return new Transform({
|
|
24
24
|
objectMode: true,
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkUDT6MZJ7js = require('./chunk-UDT6MZJ7.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
16
16
|
|
|
17
17
|
// src/bundlers/vite/index.ts
|
|
18
18
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
19
19
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
20
|
-
const opts =
|
|
20
|
+
const opts = _chunkUDT6MZJ7js.getCompilerContext.call(void 0, options);
|
|
21
21
|
const {
|
|
22
22
|
disabled,
|
|
23
23
|
onEnd,
|
|
@@ -26,7 +26,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
26
26
|
onUpdate,
|
|
27
27
|
templateHandler,
|
|
28
28
|
styleHandler,
|
|
29
|
-
patch,
|
|
30
29
|
jsHandler,
|
|
31
30
|
mainCssChunkMatcher,
|
|
32
31
|
appType,
|
|
@@ -37,13 +36,13 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
37
36
|
if (disabled) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
patch
|
|
39
|
+
twPatcher.patch();
|
|
41
40
|
onLoad();
|
|
42
41
|
return {
|
|
43
|
-
name:
|
|
42
|
+
name: _chunkN62XM3T3js.vitePluginName,
|
|
44
43
|
enforce: "post",
|
|
45
44
|
generateBundle(_opt, bundle) {
|
|
46
|
-
return
|
|
45
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
47
46
|
debug("start");
|
|
48
47
|
onStart();
|
|
49
48
|
const entries = Object.entries(bundle);
|
|
@@ -53,8 +52,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
53
52
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
54
53
|
if (Array.isArray(groupedEntries.html)) {
|
|
55
54
|
let noCachedCount = 0;
|
|
56
|
-
for (
|
|
57
|
-
const [file, originalSource] =
|
|
55
|
+
for (const element of groupedEntries.html) {
|
|
56
|
+
const [file, originalSource] = element;
|
|
58
57
|
const oldVal = originalSource.source.toString();
|
|
59
58
|
const hash = cache.computeHash(oldVal);
|
|
60
59
|
cache.calcHashValueChanged(file, hash);
|
|
@@ -69,7 +68,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
69
68
|
return false;
|
|
70
69
|
}
|
|
71
70
|
},
|
|
72
|
-
() =>
|
|
71
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
73
72
|
originalSource.source = yield templateHandler(oldVal, {
|
|
74
73
|
runtimeSet
|
|
75
74
|
});
|
|
@@ -87,8 +86,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
87
86
|
}
|
|
88
87
|
if (Array.isArray(groupedEntries.js)) {
|
|
89
88
|
let noCachedCount = 0;
|
|
90
|
-
for (
|
|
91
|
-
const [file, originalSource] =
|
|
89
|
+
for (const element of groupedEntries.js) {
|
|
90
|
+
const [file, originalSource] = element;
|
|
92
91
|
const rawSource = originalSource.code;
|
|
93
92
|
const hash = cache.computeHash(rawSource);
|
|
94
93
|
cache.calcHashValueChanged(file, hash);
|
|
@@ -103,7 +102,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
103
102
|
return false;
|
|
104
103
|
}
|
|
105
104
|
},
|
|
106
|
-
() =>
|
|
105
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
107
106
|
const mapFilename = `${file}.map`;
|
|
108
107
|
const hasMap = Boolean(bundle[mapFilename]);
|
|
109
108
|
const { code, map } = yield jsHandler(rawSource, runtimeSet, {
|
|
@@ -128,8 +127,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
128
127
|
}
|
|
129
128
|
if (Array.isArray(groupedEntries.css)) {
|
|
130
129
|
let noCachedCount = 0;
|
|
131
|
-
for (
|
|
132
|
-
const [file, originalSource] =
|
|
130
|
+
for (const element of groupedEntries.css) {
|
|
131
|
+
const [file, originalSource] = element;
|
|
133
132
|
const rawSource = originalSource.source.toString();
|
|
134
133
|
const hash = cache.computeHash(rawSource);
|
|
135
134
|
cache.calcHashValueChanged(file, hash);
|
|
@@ -144,7 +143,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
144
143
|
return false;
|
|
145
144
|
}
|
|
146
145
|
},
|
|
147
|
-
() =>
|
|
146
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
148
147
|
const { css } = yield styleHandler(rawSource, {
|
|
149
148
|
isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType)
|
|
150
149
|
});
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUDT6MZJ7js = require('./chunk-UDT6MZJ7.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,15 +15,15 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
|
15
15
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
16
16
|
var Transform = _stream2.default.Transform;
|
|
17
17
|
function createPlugins(options = {}) {
|
|
18
|
-
const opts =
|
|
19
|
-
const { templateHandler, styleHandler,
|
|
18
|
+
const opts = _chunkUDT6MZJ7js.getCompilerContext.call(void 0, options);
|
|
19
|
+
const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
|
|
20
20
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
21
|
-
patch
|
|
21
|
+
twPatcher.patch();
|
|
22
22
|
function transformWxss(options2 = {}) {
|
|
23
23
|
return new Transform({
|
|
24
24
|
objectMode: true,
|
|
25
25
|
transform(file, _encoding, callback) {
|
|
26
|
-
return
|
|
26
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
27
27
|
runtimeSet = twPatcher.getClassSet();
|
|
28
28
|
setMangleRuntimeSet(runtimeSet);
|
|
29
29
|
const error = null;
|
|
@@ -42,8 +42,8 @@ function createPlugins(options = {}) {
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
() =>
|
|
46
|
-
const { css } = yield styleHandler(rawSource,
|
|
45
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
46
|
+
const { css } = yield styleHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
|
|
47
47
|
isMainChunk: true
|
|
48
48
|
}, options2));
|
|
49
49
|
file.contents = _buffer.Buffer.from(css);
|
|
@@ -68,7 +68,7 @@ function createPlugins(options = {}) {
|
|
|
68
68
|
return new Transform({
|
|
69
69
|
objectMode: true,
|
|
70
70
|
transform(file, _encoding, callback) {
|
|
71
|
-
return
|
|
71
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
72
72
|
const error = null;
|
|
73
73
|
if (file.contents) {
|
|
74
74
|
const rawSource = file.contents.toString();
|
|
@@ -85,7 +85,7 @@ function createPlugins(options = {}) {
|
|
|
85
85
|
return false;
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
() =>
|
|
88
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
89
89
|
const { code } = yield jsHandler(rawSource, runtimeSet, options2);
|
|
90
90
|
file.contents = _buffer.Buffer.from(code);
|
|
91
91
|
debug("js handle: %s", file.path);
|
|
@@ -105,7 +105,7 @@ function createPlugins(options = {}) {
|
|
|
105
105
|
return new Transform({
|
|
106
106
|
objectMode: true,
|
|
107
107
|
transform(file, _encoding, callback) {
|
|
108
|
-
return
|
|
108
|
+
return _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
109
109
|
const error = null;
|
|
110
110
|
if (file.contents) {
|
|
111
111
|
const rawSource = file.contents.toString();
|
|
@@ -122,8 +122,8 @@ function createPlugins(options = {}) {
|
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
() =>
|
|
126
|
-
const code = yield templateHandler(rawSource,
|
|
125
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
126
|
+
const code = yield templateHandler(rawSource, _chunk6FNC3XMIjs.__spreadValues.call(void 0, {
|
|
127
127
|
runtimeSet
|
|
128
128
|
}, options2));
|
|
129
129
|
file.contents = _buffer.Buffer.from(code);
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
var _chunkHBQASQKYjs = require('./chunk-HBQASQKY.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkN62XM3T3js = require('./chunk-N62XM3T3.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkUDT6MZJ7js = require('./chunk-UDT6MZJ7.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunk35CYTBPMjs = require('./chunk-35CYTBPM.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunk6FNC3XMIjs = require('./chunk-6FNC3XMI.js');
|
|
17
17
|
|
|
18
18
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
19
19
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -21,7 +21,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
21
21
|
var debug = _chunkHBQASQKYjs.createDebug.call(void 0, );
|
|
22
22
|
var UnifiedWebpackPluginV5 = class {
|
|
23
23
|
constructor(options = {}) {
|
|
24
|
-
this.options =
|
|
24
|
+
this.options = _chunkUDT6MZJ7js.getCompilerContext.call(void 0, options);
|
|
25
25
|
this.appType = this.options.appType;
|
|
26
26
|
}
|
|
27
27
|
apply(compiler) {
|
|
@@ -33,7 +33,6 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
33
33
|
onEnd,
|
|
34
34
|
onStart,
|
|
35
35
|
styleHandler,
|
|
36
|
-
patch,
|
|
37
36
|
templateHandler,
|
|
38
37
|
jsHandler,
|
|
39
38
|
setMangleRuntimeSet,
|
|
@@ -44,7 +43,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
44
43
|
if (disabled) {
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
|
-
patch
|
|
46
|
+
twPatcher.patch();
|
|
48
47
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
49
48
|
const { ConcatSource, RawSource } = sources;
|
|
50
49
|
function getClassSet() {
|
|
@@ -61,8 +60,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
61
60
|
ident: null,
|
|
62
61
|
type: null
|
|
63
62
|
};
|
|
64
|
-
compiler.hooks.compilation.tap(
|
|
65
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
63
|
+
compiler.hooks.compilation.tap(_chunkN62XM3T3js.pluginName, (compilation) => {
|
|
64
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkN62XM3T3js.pluginName, (_loaderContext, module) => {
|
|
66
65
|
if (isExisted) {
|
|
67
66
|
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
68
67
|
if (idx > -1) {
|
|
@@ -72,10 +71,10 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
72
71
|
});
|
|
73
72
|
compilation.hooks.processAssets.tapPromise(
|
|
74
73
|
{
|
|
75
|
-
name:
|
|
74
|
+
name: _chunkN62XM3T3js.pluginName,
|
|
76
75
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
77
76
|
},
|
|
78
|
-
(assets) =>
|
|
77
|
+
(assets) => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
79
78
|
onStart();
|
|
80
79
|
debug("start");
|
|
81
80
|
for (const chunk of compilation.chunks) {
|
|
@@ -90,8 +89,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
90
89
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
91
90
|
if (Array.isArray(groupedEntries.html)) {
|
|
92
91
|
let noCachedCount = 0;
|
|
93
|
-
for (
|
|
94
|
-
const [file, originalSource] =
|
|
92
|
+
for (const element of groupedEntries.html) {
|
|
93
|
+
const [file, originalSource] = element;
|
|
95
94
|
const rawSource = originalSource.source().toString();
|
|
96
95
|
const hash = cache.computeHash(rawSource);
|
|
97
96
|
const cacheKey = file;
|
|
@@ -107,7 +106,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
107
106
|
return false;
|
|
108
107
|
}
|
|
109
108
|
},
|
|
110
|
-
() =>
|
|
109
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
111
110
|
const wxml = yield templateHandler(rawSource, {
|
|
112
111
|
runtimeSet
|
|
113
112
|
});
|
|
@@ -127,8 +126,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
127
126
|
}
|
|
128
127
|
if (Array.isArray(groupedEntries.js)) {
|
|
129
128
|
let noCachedCount = 0;
|
|
130
|
-
for (
|
|
131
|
-
const [file, originalSource] =
|
|
129
|
+
for (const element of groupedEntries.js) {
|
|
130
|
+
const [file, originalSource] = element;
|
|
132
131
|
const cacheKey = _chunk35CYTBPMjs.removeExt.call(void 0, file);
|
|
133
132
|
yield cache.process(
|
|
134
133
|
cacheKey,
|
|
@@ -141,7 +140,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
141
140
|
return false;
|
|
142
141
|
}
|
|
143
142
|
},
|
|
144
|
-
() =>
|
|
143
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
145
144
|
const rawSource = originalSource.source().toString();
|
|
146
145
|
const mapFilename = `${file}.map`;
|
|
147
146
|
const hasMap = Boolean(assets[mapFilename]);
|
|
@@ -168,8 +167,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
168
167
|
}
|
|
169
168
|
if (Array.isArray(groupedEntries.css)) {
|
|
170
169
|
let noCachedCount = 0;
|
|
171
|
-
for (
|
|
172
|
-
const [file, originalSource] =
|
|
170
|
+
for (const element of groupedEntries.css) {
|
|
171
|
+
const [file, originalSource] = element;
|
|
173
172
|
const rawSource = originalSource.source().toString();
|
|
174
173
|
const hash = cache.computeHash(rawSource);
|
|
175
174
|
const cacheKey = file;
|
|
@@ -185,7 +184,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
185
184
|
return false;
|
|
186
185
|
}
|
|
187
186
|
},
|
|
188
|
-
() =>
|
|
187
|
+
() => _chunk6FNC3XMIjs.__async.call(void 0, this, null, function* () {
|
|
189
188
|
const { css } = yield styleHandler(rawSource, {
|
|
190
189
|
isMainChunk: mainCssChunkMatcher(file, this.appType)
|
|
191
190
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/wxml/shared.ts
|
|
2
|
-
import { escape,
|
|
2
|
+
import { escape, MappingChars2String } from "@weapp-core/escape";
|
|
3
3
|
function replaceWxml(original, options = {
|
|
4
4
|
keepEOL: false,
|
|
5
|
-
escapeMap:
|
|
5
|
+
escapeMap: MappingChars2String
|
|
6
6
|
}) {
|
|
7
7
|
const { keepEOL, escapeMap, mangleContext, ignoreHead } = options;
|
|
8
8
|
let res = original;
|