weapp-tailwindcss 3.0.9 → 3.0.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/cache/index.d.ts +2 -1
- package/dist/cli.js +5 -5
- package/dist/cli.mjs +5 -5
- package/dist/core.js +5 -5
- package/dist/core.mjs +5 -5
- package/dist/css-macro/index.js +2 -2
- package/dist/css-macro/index.mjs +2 -2
- package/dist/css-macro/postcss.js +4 -4
- package/dist/css-macro/postcss.mjs +4 -4
- package/dist/{defaults-1lCMiqik.js → defaults-BT3A8Rzc.js} +1 -1
- package/dist/{defaults-c-Db9ovX.mjs → defaults-CBb6_9nJ.mjs} +1 -1
- package/dist/defaults.js +2 -2
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.js +8 -6
- package/dist/gulp.mjs +8 -6
- package/dist/{index-63THS8xH.js → index-BgWX0vrB.js} +5 -5
- package/dist/{index-Fkmyt0Rc.js → index-CarwQa1I.js} +7 -3
- package/dist/index-CgOpm8dH.mjs +130 -0
- package/dist/{index-06BoOZig.mjs → index-CsZGfl55.mjs} +3 -2
- package/dist/{index-KDDyuNhv.mjs → index-DG4lzarS.mjs} +5 -5
- package/dist/{index-_74RBzwy.mjs → index-DKNUquoz.mjs} +7 -3
- package/dist/{index-juOeq2Kt.js → index-DyK5Vd4R.js} +3 -2
- package/dist/index-FotLKQvj.js +136 -0
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/js/handlers.d.ts +1 -1
- package/dist/{options-Z3Pay3SJ.mjs → options-D8LYG9j8.mjs} +42 -38
- package/dist/{options-ymQS0nTj.js → options-Zf1-GLWG.js} +42 -38
- package/dist/postcss.js +2 -2
- package/dist/postcss.mjs +2 -2
- package/dist/replace.js +1 -1
- package/dist/replace.mjs +1 -1
- package/dist/types.d.ts +4 -2
- package/dist/{v5-uxlJgYR1.mjs → v5-B8nkZNYC.mjs} +5 -5
- package/dist/{v5-wLmuN-qW.js → v5-eVqDacrp.js} +5 -5
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +7 -7
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +7 -7
- package/dist/webpack4.js +7 -7
- package/dist/webpack4.mjs +7 -7
- package/package.json +34 -34
- package/dist/index-JQFi9orv.js +0 -70
- package/dist/index-q-Es6emh.mjs +0 -64
- /package/dist/{constants-ol1NPf7z.mjs → constants-CcqTvLgQ.mjs} +0 -0
- /package/dist/{constants-EVxkHOXL.js → constants-D-YMDg7M.js} +0 -0
- /package/dist/{defu-6bFjC68s.js → defu-Cdz2PomB.js} +0 -0
- /package/dist/{defu-p1R_k1Ss.mjs → defu-n46TJT6t.mjs} +0 -0
- /package/dist/{shared-AxeHlAoJ.js → shared-BDew1Ric.js} +0 -0
- /package/dist/{shared-0D5OOeXo.mjs → shared-BX0VV-pr.mjs} +0 -0
package/dist/cache/index.d.ts
CHANGED
|
@@ -26,5 +26,6 @@ export interface ICreateCacheReturnType {
|
|
|
26
26
|
source: CacheValue;
|
|
27
27
|
}>) => void | Promise<void>;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
export type ICreateCacheOptions = boolean;
|
|
30
|
+
declare function createCache(options?: ICreateCacheOptions): ICreateCacheReturnType;
|
|
30
31
|
export { createCache };
|
package/dist/cli.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var semver = require('semver');
|
|
4
|
-
var options = require('./options-
|
|
5
|
-
var index = require('./index-
|
|
4
|
+
var options = require('./options-Zf1-GLWG.js');
|
|
5
|
+
var index = require('./index-CarwQa1I.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
|
9
9
|
require('@ast-core/escape');
|
|
10
|
-
require('./shared-
|
|
10
|
+
require('./shared-BDew1Ric.js');
|
|
11
11
|
require('@weapp-core/regex');
|
|
12
12
|
require('@babel/generator');
|
|
13
13
|
require('@babel/parser');
|
|
14
14
|
require('@babel/traverse');
|
|
15
|
-
require('./defaults-
|
|
16
|
-
require('./defu-
|
|
15
|
+
require('./defaults-BT3A8Rzc.js');
|
|
16
|
+
require('./defu-Cdz2PomB.js');
|
|
17
17
|
require('@babel/types');
|
|
18
18
|
require('htmlparser2');
|
|
19
19
|
require('postcss');
|
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { g as getOptions, a as createPatch } from './options-
|
|
3
|
-
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-
|
|
2
|
+
import { g as getOptions, a as createPatch } from './options-D8LYG9j8.mjs';
|
|
3
|
+
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-DKNUquoz.mjs';
|
|
4
4
|
import 'magic-string';
|
|
5
5
|
import './replace.mjs';
|
|
6
6
|
import '@weapp-core/escape';
|
|
7
7
|
import '@ast-core/escape';
|
|
8
|
-
import './shared-
|
|
8
|
+
import './shared-BX0VV-pr.mjs';
|
|
9
9
|
import '@weapp-core/regex';
|
|
10
10
|
import '@babel/generator';
|
|
11
11
|
import '@babel/parser';
|
|
12
12
|
import '@babel/traverse';
|
|
13
|
-
import './defaults-
|
|
14
|
-
import './defu-
|
|
13
|
+
import './defaults-CBb6_9nJ.mjs';
|
|
14
|
+
import './defu-n46TJT6t.mjs';
|
|
15
15
|
import '@babel/types';
|
|
16
16
|
import 'htmlparser2';
|
|
17
17
|
import 'postcss';
|
package/dist/core.js
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var options = require('./options-
|
|
5
|
+
var options = require('./options-Zf1-GLWG.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
|
9
9
|
require('@ast-core/escape');
|
|
10
|
-
require('./shared-
|
|
10
|
+
require('./shared-BDew1Ric.js');
|
|
11
11
|
require('@weapp-core/regex');
|
|
12
12
|
require('@babel/generator');
|
|
13
13
|
require('@babel/parser');
|
|
14
14
|
require('@babel/traverse');
|
|
15
|
-
require('./defaults-
|
|
16
|
-
require('./defu-
|
|
15
|
+
require('./defaults-BT3A8Rzc.js');
|
|
16
|
+
require('./defu-Cdz2PomB.js');
|
|
17
17
|
require('@babel/types');
|
|
18
18
|
require('htmlparser2');
|
|
19
19
|
require('postcss');
|
|
20
|
-
require('./index-
|
|
20
|
+
require('./index-CarwQa1I.js');
|
|
21
21
|
require('@csstools/postcss-is-pseudo-class');
|
|
22
22
|
require('postcss-rem-to-responsive-pixel');
|
|
23
23
|
require('postcss-selector-parser');
|
package/dist/core.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
|
|
2
2
|
import 'magic-string';
|
|
3
3
|
import './replace.mjs';
|
|
4
4
|
import '@weapp-core/escape';
|
|
5
5
|
import '@ast-core/escape';
|
|
6
|
-
import './shared-
|
|
6
|
+
import './shared-BX0VV-pr.mjs';
|
|
7
7
|
import '@weapp-core/regex';
|
|
8
8
|
import '@babel/generator';
|
|
9
9
|
import '@babel/parser';
|
|
10
10
|
import '@babel/traverse';
|
|
11
|
-
import './defaults-
|
|
12
|
-
import './defu-
|
|
11
|
+
import './defaults-CBb6_9nJ.mjs';
|
|
12
|
+
import './defu-n46TJT6t.mjs';
|
|
13
13
|
import '@babel/types';
|
|
14
14
|
import 'htmlparser2';
|
|
15
15
|
import 'postcss';
|
|
16
|
-
import './index-
|
|
16
|
+
import './index-DKNUquoz.mjs';
|
|
17
17
|
import '@csstools/postcss-is-pseudo-class';
|
|
18
18
|
import 'postcss-rem-to-responsive-pixel';
|
|
19
19
|
import 'postcss-selector-parser';
|
package/dist/css-macro/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var plugin = require('tailwindcss/plugin');
|
|
4
|
-
var constants = require('../constants-
|
|
5
|
-
var defu = require('../defu-
|
|
4
|
+
var constants = require('../constants-D-YMDg7M.js');
|
|
5
|
+
var defu = require('../defu-Cdz2PomB.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
8
|
|
package/dist/css-macro/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import plugin from 'tailwindcss/plugin';
|
|
2
|
-
import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-
|
|
3
|
-
import { d as defu } from '../defu-
|
|
2
|
+
import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-CcqTvLgQ.mjs';
|
|
3
|
+
import { d as defu } from '../defu-n46TJT6t.mjs';
|
|
4
4
|
|
|
5
5
|
var index = plugin.withOptions((options) => {
|
|
6
6
|
const { dynamic: dynamicMode, variantsMap } = defu(options, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var constants = require('../constants-
|
|
3
|
+
var constants = require('../constants-D-YMDg7M.js');
|
|
4
4
|
|
|
5
5
|
const creator = () => {
|
|
6
6
|
return {
|
|
@@ -8,6 +8,7 @@ const creator = () => {
|
|
|
8
8
|
prepare() {
|
|
9
9
|
return {
|
|
10
10
|
AtRule(atRule, helper) {
|
|
11
|
+
var _a;
|
|
11
12
|
if (atRule.name === 'media') {
|
|
12
13
|
const values = [];
|
|
13
14
|
constants.matchCustomPropertyFromValue(atRule.params, (arr) => {
|
|
@@ -17,14 +18,14 @@ const creator = () => {
|
|
|
17
18
|
const isNegative = atRule.params.includes('not');
|
|
18
19
|
const text = values.join(' ');
|
|
19
20
|
const comment = isNegative ? constants.ifndef(text) : constants.ifdef(text);
|
|
20
|
-
atRule.
|
|
21
|
+
atRule.replaceWith([
|
|
21
22
|
helper.comment({
|
|
22
23
|
raws: {
|
|
23
24
|
before: '\n'
|
|
24
25
|
},
|
|
25
26
|
text: comment.start
|
|
26
27
|
}),
|
|
27
|
-
...atRule.nodes,
|
|
28
|
+
...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
|
|
28
29
|
helper.comment({
|
|
29
30
|
raws: {
|
|
30
31
|
before: '\n'
|
|
@@ -32,7 +33,6 @@ const creator = () => {
|
|
|
32
33
|
text: comment.end
|
|
33
34
|
})
|
|
34
35
|
]);
|
|
35
|
-
atRule.remove();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-
|
|
1
|
+
import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-CcqTvLgQ.mjs';
|
|
2
2
|
|
|
3
3
|
const creator = () => {
|
|
4
4
|
return {
|
|
@@ -6,6 +6,7 @@ const creator = () => {
|
|
|
6
6
|
prepare() {
|
|
7
7
|
return {
|
|
8
8
|
AtRule(atRule, helper) {
|
|
9
|
+
var _a;
|
|
9
10
|
if (atRule.name === 'media') {
|
|
10
11
|
const values = [];
|
|
11
12
|
matchCustomPropertyFromValue(atRule.params, (arr) => {
|
|
@@ -15,14 +16,14 @@ const creator = () => {
|
|
|
15
16
|
const isNegative = atRule.params.includes('not');
|
|
16
17
|
const text = values.join(' ');
|
|
17
18
|
const comment = isNegative ? ifndef(text) : ifdef(text);
|
|
18
|
-
atRule.
|
|
19
|
+
atRule.replaceWith([
|
|
19
20
|
helper.comment({
|
|
20
21
|
raws: {
|
|
21
22
|
before: '\n'
|
|
22
23
|
},
|
|
23
24
|
text: comment.start
|
|
24
25
|
}),
|
|
25
|
-
...atRule.nodes,
|
|
26
|
+
...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
|
|
26
27
|
helper.comment({
|
|
27
28
|
raws: {
|
|
28
29
|
before: '\n'
|
|
@@ -30,7 +31,6 @@ const creator = () => {
|
|
|
30
31
|
text: comment.end
|
|
31
32
|
})
|
|
32
33
|
]);
|
|
33
|
-
atRule.remove();
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
package/dist/defaults.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var defaults = require('./defaults-
|
|
5
|
+
var defaults = require('./defaults-BT3A8Rzc.js');
|
|
6
6
|
require('@weapp-core/escape');
|
|
7
7
|
require('@ast-core/escape');
|
|
8
|
-
require('./defu-
|
|
8
|
+
require('./defu-Cdz2PomB.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
package/dist/defaults.mjs
CHANGED
package/dist/gulp.js
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('./options-
|
|
5
|
+
var index = require('./index-FotLKQvj.js');
|
|
6
|
+
require('./options-Zf1-GLWG.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
10
10
|
require('@ast-core/escape');
|
|
11
|
-
require('./shared-
|
|
11
|
+
require('./shared-BDew1Ric.js');
|
|
12
12
|
require('@weapp-core/regex');
|
|
13
13
|
require('@babel/generator');
|
|
14
14
|
require('@babel/parser');
|
|
15
15
|
require('@babel/traverse');
|
|
16
|
-
require('./defaults-
|
|
17
|
-
require('./defu-
|
|
16
|
+
require('./defaults-BT3A8Rzc.js');
|
|
17
|
+
require('./defu-Cdz2PomB.js');
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-CarwQa1I.js');
|
|
22
22
|
require('@csstools/postcss-is-pseudo-class');
|
|
23
23
|
require('postcss-rem-to-responsive-pixel');
|
|
24
24
|
require('postcss-selector-parser');
|
|
@@ -30,6 +30,8 @@ require('@tailwindcss-mangle/shared');
|
|
|
30
30
|
require('lru-cache');
|
|
31
31
|
require('md5');
|
|
32
32
|
require('node:stream');
|
|
33
|
+
require('./index-DyK5Vd4R.js');
|
|
34
|
+
require('debug');
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { c as createPlugins } from './index-
|
|
2
|
-
import './options-
|
|
1
|
+
export { c as createPlugins } from './index-CgOpm8dH.mjs';
|
|
2
|
+
import './options-D8LYG9j8.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
6
6
|
import '@ast-core/escape';
|
|
7
|
-
import './shared-
|
|
7
|
+
import './shared-BX0VV-pr.mjs';
|
|
8
8
|
import '@weapp-core/regex';
|
|
9
9
|
import '@babel/generator';
|
|
10
10
|
import '@babel/parser';
|
|
11
11
|
import '@babel/traverse';
|
|
12
|
-
import './defaults-
|
|
13
|
-
import './defu-
|
|
12
|
+
import './defaults-CBb6_9nJ.mjs';
|
|
13
|
+
import './defu-n46TJT6t.mjs';
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
17
|
+
import './index-DKNUquoz.mjs';
|
|
18
18
|
import '@csstools/postcss-is-pseudo-class';
|
|
19
19
|
import 'postcss-rem-to-responsive-pixel';
|
|
20
20
|
import 'postcss-selector-parser';
|
|
@@ -26,3 +26,5 @@ import '@tailwindcss-mangle/shared';
|
|
|
26
26
|
import 'lru-cache';
|
|
27
27
|
import 'md5';
|
|
28
28
|
import 'node:stream';
|
|
29
|
+
import './index-CsZGfl55.mjs';
|
|
30
|
+
import 'debug';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
4
|
-
var index = require('./index-
|
|
5
|
-
var defaults = require('./defaults-
|
|
6
|
-
var index$1 = require('./index-
|
|
3
|
+
var options = require('./options-Zf1-GLWG.js');
|
|
4
|
+
var index = require('./index-CarwQa1I.js');
|
|
5
|
+
var defaults = require('./defaults-BT3A8Rzc.js');
|
|
6
|
+
var index$1 = require('./index-DyK5Vd4R.js');
|
|
7
7
|
|
|
8
|
-
const debug = index$1.createDebug(
|
|
8
|
+
const debug = index$1.createDebug();
|
|
9
9
|
function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
10
10
|
if (options$1.customReplaceDictionary === undefined) {
|
|
11
11
|
options$1.customReplaceDictionary = 'simple';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
|
|
4
4
|
var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
|
|
5
5
|
var selectorParser = require('postcss-selector-parser');
|
|
6
|
-
var shared = require('./shared-
|
|
6
|
+
var shared = require('./shared-BDew1Ric.js');
|
|
7
7
|
var postcss = require('postcss');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -396,8 +396,12 @@ const postcssWeappTailwindcssPrePlugin = (options = {
|
|
|
396
396
|
},
|
|
397
397
|
AtRule(atRule) {
|
|
398
398
|
if (isAtMediaHover(atRule)) {
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
if (atRule.nodes) {
|
|
400
|
+
atRule.replaceWith(atRule.nodes);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
atRule.remove();
|
|
404
|
+
}
|
|
401
405
|
}
|
|
402
406
|
}
|
|
403
407
|
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
|
|
2
|
+
import stream from 'node:stream';
|
|
3
|
+
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
4
|
+
|
|
5
|
+
const debug = createDebug();
|
|
6
|
+
const Transform = stream.Transform;
|
|
7
|
+
function createPlugins(options = {}) {
|
|
8
|
+
const opts = getOptions(options);
|
|
9
|
+
const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir, cache } = opts;
|
|
10
|
+
let runtimeSet = new Set();
|
|
11
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
12
|
+
const twPatcher = createTailwindcssPatcher();
|
|
13
|
+
function transformWxss() {
|
|
14
|
+
return new Transform({
|
|
15
|
+
objectMode: true,
|
|
16
|
+
transform: function (file, encoding, callback) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
runtimeSet = twPatcher.getClassSet({
|
|
19
|
+
basedir: tailwindcssBasedir
|
|
20
|
+
});
|
|
21
|
+
setMangleRuntimeSet(runtimeSet);
|
|
22
|
+
const error = null;
|
|
23
|
+
if (file.contents) {
|
|
24
|
+
const rawSource = file.contents.toString();
|
|
25
|
+
const hash = cache.computeHash(rawSource);
|
|
26
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
27
|
+
yield cache.process(file.path, () => {
|
|
28
|
+
const source = cache.get(file.path);
|
|
29
|
+
if (source) {
|
|
30
|
+
file.contents = Buffer.from(source);
|
|
31
|
+
debug('css cache hit: %s', file.path);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const code = yield styleHandler(rawSource, {
|
|
38
|
+
isMainChunk: true
|
|
39
|
+
});
|
|
40
|
+
file.contents = Buffer.from(code);
|
|
41
|
+
debug('css handle: %s', file.path);
|
|
42
|
+
return {
|
|
43
|
+
key: file.path,
|
|
44
|
+
source: code
|
|
45
|
+
};
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
callback(error, file);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function transformJs() {
|
|
54
|
+
return new Transform({
|
|
55
|
+
objectMode: true,
|
|
56
|
+
transform: function (file, encoding, callback) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const error = null;
|
|
59
|
+
if (file.contents) {
|
|
60
|
+
const rawSource = file.contents.toString();
|
|
61
|
+
const hash = cache.computeHash(rawSource);
|
|
62
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
63
|
+
yield cache.process(file.path, () => {
|
|
64
|
+
const source = cache.get(file.path);
|
|
65
|
+
if (source) {
|
|
66
|
+
file.contents = Buffer.from(source);
|
|
67
|
+
debug('js cache hit: %s', file.path);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}, () => {
|
|
73
|
+
const { code } = jsHandler(rawSource, runtimeSet);
|
|
74
|
+
file.contents = Buffer.from(code);
|
|
75
|
+
debug('js handle: %s', file.path);
|
|
76
|
+
return {
|
|
77
|
+
key: file.path,
|
|
78
|
+
source: code
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
callback(error, file);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function transformWxml() {
|
|
88
|
+
return new Transform({
|
|
89
|
+
objectMode: true,
|
|
90
|
+
transform: function (file, encoding, callback) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const error = null;
|
|
93
|
+
if (file.contents) {
|
|
94
|
+
const rawSource = file.contents.toString();
|
|
95
|
+
const hash = cache.computeHash(rawSource);
|
|
96
|
+
cache.calcHashValueChanged(file.path, hash);
|
|
97
|
+
yield cache.process(file.path, () => {
|
|
98
|
+
const source = cache.get(file.path);
|
|
99
|
+
if (source) {
|
|
100
|
+
file.contents = Buffer.from(source);
|
|
101
|
+
debug('html cache hit: %s', file.path);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}, () => {
|
|
107
|
+
const code = templateHandler(rawSource, {
|
|
108
|
+
runtimeSet
|
|
109
|
+
});
|
|
110
|
+
file.contents = Buffer.from(code);
|
|
111
|
+
debug('html handle: %s', file.path);
|
|
112
|
+
return {
|
|
113
|
+
key: file.path,
|
|
114
|
+
source: code
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
callback(error, file);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
transformWxss,
|
|
125
|
+
transformWxml,
|
|
126
|
+
transformJs
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { createPlugins as c };
|
|
@@ -2,9 +2,10 @@ import _createDebug from 'debug';
|
|
|
2
2
|
|
|
3
3
|
const _debug = _createDebug('weapp-tw');
|
|
4
4
|
function createDebug(prefix) {
|
|
5
|
-
|
|
5
|
+
function debug(formatter, ...args) {
|
|
6
6
|
return _debug((prefix !== null && prefix !== void 0 ? prefix : '') + formatter, ...args);
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
return debug;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export { createDebug as c };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
2
|
-
import { v as vitePluginName } from './index-
|
|
3
|
-
import { g as getGroupedEntries } from './defaults-
|
|
4
|
-
import { c as createDebug } from './index-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
|
|
2
|
+
import { v as vitePluginName } from './index-DKNUquoz.mjs';
|
|
3
|
+
import { g as getGroupedEntries } from './defaults-CBb6_9nJ.mjs';
|
|
4
|
+
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
5
5
|
|
|
6
|
-
const debug = createDebug(
|
|
6
|
+
const debug = createDebug();
|
|
7
7
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
8
8
|
if (options.customReplaceDictionary === undefined) {
|
|
9
9
|
options.customReplaceDictionary = 'simple';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import postcssIsPseudoClass from '@csstools/postcss-is-pseudo-class';
|
|
2
2
|
import postcssRem2rpx from 'postcss-rem-to-responsive-pixel';
|
|
3
3
|
import selectorParser from 'postcss-selector-parser';
|
|
4
|
-
import { c as composeIsPseudo, i as internalCssSelectorReplacer } from './shared-
|
|
4
|
+
import { c as composeIsPseudo, i as internalCssSelectorReplacer } from './shared-BX0VV-pr.mjs';
|
|
5
5
|
import { Declaration, Rule } from 'postcss';
|
|
6
6
|
|
|
7
7
|
const createRuleTransform = (rule, options) => {
|
|
@@ -388,8 +388,12 @@ const postcssWeappTailwindcssPrePlugin = (options = {
|
|
|
388
388
|
},
|
|
389
389
|
AtRule(atRule) {
|
|
390
390
|
if (isAtMediaHover(atRule)) {
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
if (atRule.nodes) {
|
|
392
|
+
atRule.replaceWith(atRule.nodes);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
atRule.remove();
|
|
396
|
+
}
|
|
393
397
|
}
|
|
394
398
|
}
|
|
395
399
|
};
|
|
@@ -8,9 +8,10 @@ var _createDebug__default = /*#__PURE__*/_interopDefaultCompat(_createDebug);
|
|
|
8
8
|
|
|
9
9
|
const _debug = _createDebug__default["default"]('weapp-tw');
|
|
10
10
|
function createDebug(prefix) {
|
|
11
|
-
|
|
11
|
+
function debug(formatter, ...args) {
|
|
12
12
|
return _debug((prefix !== null && prefix !== void 0 ? prefix : '') + formatter, ...args);
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
|
+
return debug;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
exports.createDebug = createDebug;
|