weapp-tailwindcss 4.2.1 → 4.2.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,31 @@ function transformUVue(code, id, jsHandler, runtimeSet) {
71
71
  };
72
72
  }
73
73
 
74
+ // src/bundlers/vite/query.ts
75
+ function parseVueRequest(id) {
76
+ const [filename, rawQuery] = id.split(`?`, 2);
77
+ const query = Object.fromEntries(new URLSearchParams(rawQuery));
78
+ if (query.vue != null) {
79
+ query.vue = true;
80
+ }
81
+ if (query.index != null) {
82
+ query.index = Number(query.index);
83
+ }
84
+ if (query.raw != null) {
85
+ query.raw = true;
86
+ }
87
+ if (query.url != null) {
88
+ query.url = true;
89
+ }
90
+ if (query.scoped != null) {
91
+ query.scoped = true;
92
+ }
93
+ return {
94
+ filename,
95
+ query
96
+ };
97
+ }
98
+
74
99
  // src/bundlers/vite/index.ts
75
100
  var debug = createDebug();
76
101
  var cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
@@ -303,7 +328,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
303
328
  name: "weapp-tailwindcss:uni-app-x:css:pre",
304
329
  enforce: "pre",
305
330
  async transform(code, id) {
306
- if (isCSSRequest(id)) {
331
+ const { query } = parseVueRequest(id);
332
+ if (isCSSRequest(id) || query.vue && query.type === "style") {
307
333
  const { css, map } = await styleHandler(code, {
308
334
  isMainChunk: mainCssChunkMatcher(id, appType),
309
335
  postcssOptions: {
@@ -325,7 +351,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
325
351
  {
326
352
  name: "weapp-tailwindcss:uni-app-x:css",
327
353
  async transform(code, id) {
328
- if (isCSSRequest(id)) {
354
+ const { query } = parseVueRequest(id);
355
+ if (isCSSRequest(id) || query.vue && query.type === "style") {
329
356
  const { css, map } = await styleHandler(code, {
330
357
  isMainChunk: mainCssChunkMatcher(id, appType),
331
358
  postcssOptions: {
@@ -71,6 +71,31 @@ function transformUVue(code, id, jsHandler, runtimeSet) {
71
71
  };
72
72
  }
73
73
 
74
+ // src/bundlers/vite/query.ts
75
+ function parseVueRequest(id) {
76
+ const [filename, rawQuery] = id.split(`?`, 2);
77
+ const query = Object.fromEntries(new URLSearchParams(rawQuery));
78
+ if (query.vue != null) {
79
+ query.vue = true;
80
+ }
81
+ if (query.index != null) {
82
+ query.index = Number(query.index);
83
+ }
84
+ if (query.raw != null) {
85
+ query.raw = true;
86
+ }
87
+ if (query.url != null) {
88
+ query.url = true;
89
+ }
90
+ if (query.scoped != null) {
91
+ query.scoped = true;
92
+ }
93
+ return {
94
+ filename,
95
+ query
96
+ };
97
+ }
98
+
74
99
  // src/bundlers/vite/index.ts
75
100
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
76
101
  var cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
@@ -303,7 +328,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
303
328
  name: "weapp-tailwindcss:uni-app-x:css:pre",
304
329
  enforce: "pre",
305
330
  async transform(code, id) {
306
- if (isCSSRequest(id)) {
331
+ const { query } = parseVueRequest(id);
332
+ if (isCSSRequest(id) || query.vue && query.type === "style") {
307
333
  const { css, map } = await styleHandler(code, {
308
334
  isMainChunk: mainCssChunkMatcher(id, appType),
309
335
  postcssOptions: {
@@ -325,7 +351,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
325
351
  {
326
352
  name: "weapp-tailwindcss:uni-app-x:css",
327
353
  async transform(code, id) {
328
- if (isCSSRequest(id)) {
354
+ const { query } = parseVueRequest(id);
355
+ if (isCSSRequest(id) || query.vue && query.type === "style") {
329
356
  const { css, map } = await styleHandler(code, {
330
357
  isMainChunk: mainCssChunkMatcher(id, appType),
331
358
  postcssOptions: {
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var _chunkXPJSMUIZjs = require('./chunk-XPJSMUIZ.js');
9
9
 
10
10
 
11
11
 
12
- var _chunkRCZXL2HIjs = require('./chunk-RCZXL2HI.js');
12
+ var _chunkJJBOP2VIjs = require('./chunk-JJBOP2VI.js');
13
13
  require('./chunk-LSSLYD6B.js');
14
14
  require('./chunk-OGROHM4L.js');
15
15
  require('./chunk-PLEG4SRN.js');
@@ -23,4 +23,4 @@ require('./chunk-U5U4QBHD.js');
23
23
 
24
24
 
25
25
 
26
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkRCZXL2HIjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkZK5OYQKNjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkXPJSMUIZjs.createPlugins; exports.cssLangRE = _chunkRCZXL2HIjs.cssLangRE; exports.isCSSRequest = _chunkRCZXL2HIjs.isCSSRequest;
26
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkJJBOP2VIjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkZK5OYQKNjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkXPJSMUIZjs.createPlugins; exports.cssLangRE = _chunkJJBOP2VIjs.cssLangRE; exports.isCSSRequest = _chunkJJBOP2VIjs.isCSSRequest;
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  UnifiedViteWeappTailwindcssPlugin,
10
10
  cssLangRE,
11
11
  isCSSRequest
12
- } from "./chunk-7ZKPZ2JS.mjs";
12
+ } from "./chunk-DHRJQIWW.mjs";
13
13
  import "./chunk-3AUX4FGE.mjs";
14
14
  import "./chunk-CMUA5KCO.mjs";
15
15
  import "./chunk-FOPIY67W.mjs";
package/dist/presets.js CHANGED
@@ -10,7 +10,7 @@ require('./chunk-U5U4QBHD.js');
10
10
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
11
11
  function uniAppX(options) {
12
12
  _chunkOXASK55Qjs.logger.info(`UNI_PLATFORM: ${_process2.default.env.UNI_PLATFORM}`);
13
- const isApp = _process2.default.env.UNI_PLATFORM === "app" || _process2.default.env.UNI_PLATFORM === "app-plus";
13
+ const isApp = _process2.default.env.UNI_PLATFORM === "app" || _process2.default.env.UNI_PLATFORM === "app-plus" || _process2.default.env.UNI_PLATFORM === "app-harmony";
14
14
  return _chunkO335YLYHjs.defuOverrideArray.call(void 0,
15
15
  options.rawOptions,
16
16
  {
package/dist/presets.mjs CHANGED
@@ -10,7 +10,7 @@ import "./chunk-QKNCXAGV.mjs";
10
10
  import process from "process";
11
11
  function uniAppX(options) {
12
12
  logger.info(`UNI_PLATFORM: ${process.env.UNI_PLATFORM}`);
13
- const isApp = process.env.UNI_PLATFORM === "app" || process.env.UNI_PLATFORM === "app-plus";
13
+ const isApp = process.env.UNI_PLATFORM === "app" || process.env.UNI_PLATFORM === "app-plus" || process.env.UNI_PLATFORM === "app-harmony";
14
14
  return defuOverrideArray(
15
15
  options.rawOptions,
16
16
  {
package/dist/vite.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkRCZXL2HIjs = require('./chunk-RCZXL2HI.js');
5
+ var _chunkJJBOP2VIjs = require('./chunk-JJBOP2VI.js');
6
6
  require('./chunk-LSSLYD6B.js');
7
7
  require('./chunk-OGROHM4L.js');
8
8
  require('./chunk-PLEG4SRN.js');
@@ -14,4 +14,4 @@ require('./chunk-U5U4QBHD.js');
14
14
 
15
15
 
16
16
 
17
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkRCZXL2HIjs.UnifiedViteWeappTailwindcssPlugin; exports.cssLangRE = _chunkRCZXL2HIjs.cssLangRE; exports.isCSSRequest = _chunkRCZXL2HIjs.isCSSRequest;
17
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkJJBOP2VIjs.UnifiedViteWeappTailwindcssPlugin; exports.cssLangRE = _chunkJJBOP2VIjs.cssLangRE; exports.isCSSRequest = _chunkJJBOP2VIjs.isCSSRequest;
package/dist/vite.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  UnifiedViteWeappTailwindcssPlugin,
3
3
  cssLangRE,
4
4
  isCSSRequest
5
- } from "./chunk-7ZKPZ2JS.mjs";
5
+ } from "./chunk-DHRJQIWW.mjs";
6
6
  import "./chunk-3AUX4FGE.mjs";
7
7
  import "./chunk-CMUA5KCO.mjs";
8
8
  import "./chunk-FOPIY67W.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "4.2.1",
3
+ "version": "4.2.2-alpha.1",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -176,10 +176,10 @@
176
176
  "vue": "^3.5.18",
177
177
  "webpack-sources": "3.3.3",
178
178
  "@weapp-tailwindcss/init": "1.0.3",
179
+ "@weapp-tailwindcss/logger": "1.0.2",
179
180
  "@weapp-tailwindcss/mangle": "1.0.5",
180
181
  "@weapp-tailwindcss/postcss": "1.0.18",
181
- "@weapp-tailwindcss/shared": "1.0.3",
182
- "@weapp-tailwindcss/logger": "1.0.2"
182
+ "@weapp-tailwindcss/shared": "1.0.3"
183
183
  },
184
184
  "scripts": {
185
185
  "dev": "tsup --watch --sourcemap",