vite-plugin-uni-tailwind-processor 1.0.1 → 1.0.2
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/index.cjs +34 -31
- package/dist/index.mjs +34 -31
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1861,27 +1861,27 @@ var require_util = __commonJS({
|
|
|
1861
1861
|
};
|
|
1862
1862
|
}
|
|
1863
1863
|
var normalize = lruMemoize(function normalize2(aPath) {
|
|
1864
|
-
var
|
|
1864
|
+
var path4 = aPath;
|
|
1865
1865
|
var url = urlParse(aPath);
|
|
1866
1866
|
if (url) {
|
|
1867
1867
|
if (!url.path) {
|
|
1868
1868
|
return aPath;
|
|
1869
1869
|
}
|
|
1870
|
-
|
|
1870
|
+
path4 = url.path;
|
|
1871
1871
|
}
|
|
1872
|
-
var isAbsolute = exports2.isAbsolute(
|
|
1872
|
+
var isAbsolute = exports2.isAbsolute(path4);
|
|
1873
1873
|
var parts = [];
|
|
1874
1874
|
var start = 0;
|
|
1875
1875
|
var i = 0;
|
|
1876
1876
|
while (true) {
|
|
1877
1877
|
start = i;
|
|
1878
|
-
i =
|
|
1878
|
+
i = path4.indexOf("/", start);
|
|
1879
1879
|
if (i === -1) {
|
|
1880
|
-
parts.push(
|
|
1880
|
+
parts.push(path4.slice(start));
|
|
1881
1881
|
break;
|
|
1882
1882
|
} else {
|
|
1883
|
-
parts.push(
|
|
1884
|
-
while (i <
|
|
1883
|
+
parts.push(path4.slice(start, i));
|
|
1884
|
+
while (i < path4.length && path4[i] === "/") {
|
|
1885
1885
|
i++;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
@@ -1902,15 +1902,15 @@ var require_util = __commonJS({
|
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
|
-
|
|
1906
|
-
if (
|
|
1907
|
-
|
|
1905
|
+
path4 = parts.join("/");
|
|
1906
|
+
if (path4 === "") {
|
|
1907
|
+
path4 = isAbsolute ? "/" : ".";
|
|
1908
1908
|
}
|
|
1909
1909
|
if (url) {
|
|
1910
|
-
url.path =
|
|
1910
|
+
url.path = path4;
|
|
1911
1911
|
return urlGenerate(url);
|
|
1912
1912
|
}
|
|
1913
|
-
return
|
|
1913
|
+
return path4;
|
|
1914
1914
|
});
|
|
1915
1915
|
exports2.normalize = normalize;
|
|
1916
1916
|
function join(aRoot, aPath) {
|
|
@@ -3668,11 +3668,11 @@ var require_previous_map = __commonJS({
|
|
|
3668
3668
|
this.annotation = this.getAnnotationURL(css.substring(start, end));
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
loadFile(
|
|
3672
|
-
this.root = dirname(
|
|
3673
|
-
if (existsSync(
|
|
3674
|
-
this.mapFile =
|
|
3675
|
-
return readFileSync(
|
|
3671
|
+
loadFile(path4) {
|
|
3672
|
+
this.root = dirname(path4);
|
|
3673
|
+
if (existsSync(path4)) {
|
|
3674
|
+
this.mapFile = path4;
|
|
3675
|
+
return readFileSync(path4, "utf-8").toString().trim();
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
loadMap(file, prev) {
|
|
@@ -4370,9 +4370,9 @@ var require_map_generator = __commonJS({
|
|
|
4370
4370
|
if (typeof this.mapOpts.annotation === "string") {
|
|
4371
4371
|
from = dirname(resolve(from, this.mapOpts.annotation));
|
|
4372
4372
|
}
|
|
4373
|
-
let
|
|
4374
|
-
this.memoizedPaths.set(file,
|
|
4375
|
-
return
|
|
4373
|
+
let path4 = relative(from, file);
|
|
4374
|
+
this.memoizedPaths.set(file, path4);
|
|
4375
|
+
return path4;
|
|
4376
4376
|
}
|
|
4377
4377
|
previous() {
|
|
4378
4378
|
if (!this.previousMaps) {
|
|
@@ -4427,12 +4427,12 @@ var require_map_generator = __commonJS({
|
|
|
4427
4427
|
return window.btoa(unescape(encodeURIComponent(str)));
|
|
4428
4428
|
}
|
|
4429
4429
|
}
|
|
4430
|
-
toFileUrl(
|
|
4431
|
-
let cached = this.memoizedFileURLs.get(
|
|
4430
|
+
toFileUrl(path4) {
|
|
4431
|
+
let cached = this.memoizedFileURLs.get(path4);
|
|
4432
4432
|
if (cached) return cached;
|
|
4433
4433
|
if (pathToFileURL) {
|
|
4434
|
-
let fileURL = pathToFileURL(
|
|
4435
|
-
this.memoizedFileURLs.set(
|
|
4434
|
+
let fileURL = pathToFileURL(path4).toString();
|
|
4435
|
+
this.memoizedFileURLs.set(path4, fileURL);
|
|
4436
4436
|
return fileURL;
|
|
4437
4437
|
} else {
|
|
4438
4438
|
throw new Error(
|
|
@@ -4440,14 +4440,14 @@ var require_map_generator = __commonJS({
|
|
|
4440
4440
|
);
|
|
4441
4441
|
}
|
|
4442
4442
|
}
|
|
4443
|
-
toUrl(
|
|
4444
|
-
let cached = this.memoizedURLs.get(
|
|
4443
|
+
toUrl(path4) {
|
|
4444
|
+
let cached = this.memoizedURLs.get(path4);
|
|
4445
4445
|
if (cached) return cached;
|
|
4446
4446
|
if (sep === "\\") {
|
|
4447
|
-
|
|
4447
|
+
path4 = path4.replace(/\\/g, "/");
|
|
4448
4448
|
}
|
|
4449
|
-
let url = encodeURI(
|
|
4450
|
-
this.memoizedURLs.set(
|
|
4449
|
+
let url = encodeURI(path4).replace(/[#?]/g, encodeURIComponent);
|
|
4450
|
+
this.memoizedURLs.set(path4, url);
|
|
4451
4451
|
return url;
|
|
4452
4452
|
}
|
|
4453
4453
|
};
|
|
@@ -6082,7 +6082,7 @@ var DefaultStrategy = class extends BaseStrategyAbstract {
|
|
|
6082
6082
|
|
|
6083
6083
|
// src/UniTailwindContext.ts
|
|
6084
6084
|
var import_path = __toESM(require("path"));
|
|
6085
|
-
var defaultTailwindCssPath = import_path.default.resolve(__dirname, "
|
|
6085
|
+
var defaultTailwindCssPath = import_path.default.resolve(__dirname, "/cache/tailwindcss.css");
|
|
6086
6086
|
var UniTailwindContext = class {
|
|
6087
6087
|
/**
|
|
6088
6088
|
* 初始化
|
|
@@ -6173,6 +6173,7 @@ var UniTailwindWatcher = class {
|
|
|
6173
6173
|
};
|
|
6174
6174
|
|
|
6175
6175
|
// src/index.ts
|
|
6176
|
+
var import_path3 = __toESM(require("path"));
|
|
6176
6177
|
function viteUniTailwindProcessor(options, strategy) {
|
|
6177
6178
|
let useStrategy;
|
|
6178
6179
|
if (strategy) {
|
|
@@ -6186,7 +6187,9 @@ function viteUniTailwindProcessor(options, strategy) {
|
|
|
6186
6187
|
let _buildStarted = false;
|
|
6187
6188
|
return {
|
|
6188
6189
|
name: "vite-uni-tailwind-Processor",
|
|
6189
|
-
|
|
6190
|
+
configResolved(resolvedConfig) {
|
|
6191
|
+
options.projectPath = import_path3.default.resolve(resolvedConfig.root);
|
|
6192
|
+
;
|
|
6190
6193
|
if (_buildStarted) {
|
|
6191
6194
|
return;
|
|
6192
6195
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1861,27 +1861,27 @@ var require_util = __commonJS({
|
|
|
1861
1861
|
};
|
|
1862
1862
|
}
|
|
1863
1863
|
var normalize = lruMemoize(function normalize2(aPath) {
|
|
1864
|
-
var
|
|
1864
|
+
var path4 = aPath;
|
|
1865
1865
|
var url = urlParse(aPath);
|
|
1866
1866
|
if (url) {
|
|
1867
1867
|
if (!url.path) {
|
|
1868
1868
|
return aPath;
|
|
1869
1869
|
}
|
|
1870
|
-
|
|
1870
|
+
path4 = url.path;
|
|
1871
1871
|
}
|
|
1872
|
-
var isAbsolute = exports.isAbsolute(
|
|
1872
|
+
var isAbsolute = exports.isAbsolute(path4);
|
|
1873
1873
|
var parts = [];
|
|
1874
1874
|
var start = 0;
|
|
1875
1875
|
var i = 0;
|
|
1876
1876
|
while (true) {
|
|
1877
1877
|
start = i;
|
|
1878
|
-
i =
|
|
1878
|
+
i = path4.indexOf("/", start);
|
|
1879
1879
|
if (i === -1) {
|
|
1880
|
-
parts.push(
|
|
1880
|
+
parts.push(path4.slice(start));
|
|
1881
1881
|
break;
|
|
1882
1882
|
} else {
|
|
1883
|
-
parts.push(
|
|
1884
|
-
while (i <
|
|
1883
|
+
parts.push(path4.slice(start, i));
|
|
1884
|
+
while (i < path4.length && path4[i] === "/") {
|
|
1885
1885
|
i++;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
@@ -1902,15 +1902,15 @@ var require_util = __commonJS({
|
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
|
-
|
|
1906
|
-
if (
|
|
1907
|
-
|
|
1905
|
+
path4 = parts.join("/");
|
|
1906
|
+
if (path4 === "") {
|
|
1907
|
+
path4 = isAbsolute ? "/" : ".";
|
|
1908
1908
|
}
|
|
1909
1909
|
if (url) {
|
|
1910
|
-
url.path =
|
|
1910
|
+
url.path = path4;
|
|
1911
1911
|
return urlGenerate(url);
|
|
1912
1912
|
}
|
|
1913
|
-
return
|
|
1913
|
+
return path4;
|
|
1914
1914
|
});
|
|
1915
1915
|
exports.normalize = normalize;
|
|
1916
1916
|
function join(aRoot, aPath) {
|
|
@@ -3668,11 +3668,11 @@ var require_previous_map = __commonJS({
|
|
|
3668
3668
|
this.annotation = this.getAnnotationURL(css.substring(start, end));
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
loadFile(
|
|
3672
|
-
this.root = dirname(
|
|
3673
|
-
if (existsSync(
|
|
3674
|
-
this.mapFile =
|
|
3675
|
-
return readFileSync(
|
|
3671
|
+
loadFile(path4) {
|
|
3672
|
+
this.root = dirname(path4);
|
|
3673
|
+
if (existsSync(path4)) {
|
|
3674
|
+
this.mapFile = path4;
|
|
3675
|
+
return readFileSync(path4, "utf-8").toString().trim();
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
loadMap(file, prev) {
|
|
@@ -4370,9 +4370,9 @@ var require_map_generator = __commonJS({
|
|
|
4370
4370
|
if (typeof this.mapOpts.annotation === "string") {
|
|
4371
4371
|
from = dirname(resolve(from, this.mapOpts.annotation));
|
|
4372
4372
|
}
|
|
4373
|
-
let
|
|
4374
|
-
this.memoizedPaths.set(file,
|
|
4375
|
-
return
|
|
4373
|
+
let path4 = relative(from, file);
|
|
4374
|
+
this.memoizedPaths.set(file, path4);
|
|
4375
|
+
return path4;
|
|
4376
4376
|
}
|
|
4377
4377
|
previous() {
|
|
4378
4378
|
if (!this.previousMaps) {
|
|
@@ -4427,12 +4427,12 @@ var require_map_generator = __commonJS({
|
|
|
4427
4427
|
return window.btoa(unescape(encodeURIComponent(str)));
|
|
4428
4428
|
}
|
|
4429
4429
|
}
|
|
4430
|
-
toFileUrl(
|
|
4431
|
-
let cached = this.memoizedFileURLs.get(
|
|
4430
|
+
toFileUrl(path4) {
|
|
4431
|
+
let cached = this.memoizedFileURLs.get(path4);
|
|
4432
4432
|
if (cached) return cached;
|
|
4433
4433
|
if (pathToFileURL) {
|
|
4434
|
-
let fileURL = pathToFileURL(
|
|
4435
|
-
this.memoizedFileURLs.set(
|
|
4434
|
+
let fileURL = pathToFileURL(path4).toString();
|
|
4435
|
+
this.memoizedFileURLs.set(path4, fileURL);
|
|
4436
4436
|
return fileURL;
|
|
4437
4437
|
} else {
|
|
4438
4438
|
throw new Error(
|
|
@@ -4440,14 +4440,14 @@ var require_map_generator = __commonJS({
|
|
|
4440
4440
|
);
|
|
4441
4441
|
}
|
|
4442
4442
|
}
|
|
4443
|
-
toUrl(
|
|
4444
|
-
let cached = this.memoizedURLs.get(
|
|
4443
|
+
toUrl(path4) {
|
|
4444
|
+
let cached = this.memoizedURLs.get(path4);
|
|
4445
4445
|
if (cached) return cached;
|
|
4446
4446
|
if (sep === "\\") {
|
|
4447
|
-
|
|
4447
|
+
path4 = path4.replace(/\\/g, "/");
|
|
4448
4448
|
}
|
|
4449
|
-
let url = encodeURI(
|
|
4450
|
-
this.memoizedURLs.set(
|
|
4449
|
+
let url = encodeURI(path4).replace(/[#?]/g, encodeURIComponent);
|
|
4450
|
+
this.memoizedURLs.set(path4, url);
|
|
4451
4451
|
return url;
|
|
4452
4452
|
}
|
|
4453
4453
|
};
|
|
@@ -6075,7 +6075,7 @@ var DefaultStrategy = class extends BaseStrategyAbstract {
|
|
|
6075
6075
|
|
|
6076
6076
|
// src/UniTailwindContext.ts
|
|
6077
6077
|
import path from "path";
|
|
6078
|
-
var defaultTailwindCssPath = path.resolve(__dirname, "
|
|
6078
|
+
var defaultTailwindCssPath = path.resolve(__dirname, "/cache/tailwindcss.css");
|
|
6079
6079
|
var UniTailwindContext = class {
|
|
6080
6080
|
/**
|
|
6081
6081
|
* 初始化
|
|
@@ -6166,6 +6166,7 @@ var UniTailwindWatcher = class {
|
|
|
6166
6166
|
};
|
|
6167
6167
|
|
|
6168
6168
|
// src/index.ts
|
|
6169
|
+
import path3 from "path";
|
|
6169
6170
|
function viteUniTailwindProcessor(options, strategy) {
|
|
6170
6171
|
let useStrategy;
|
|
6171
6172
|
if (strategy) {
|
|
@@ -6179,7 +6180,9 @@ function viteUniTailwindProcessor(options, strategy) {
|
|
|
6179
6180
|
let _buildStarted = false;
|
|
6180
6181
|
return {
|
|
6181
6182
|
name: "vite-uni-tailwind-Processor",
|
|
6182
|
-
|
|
6183
|
+
configResolved(resolvedConfig) {
|
|
6184
|
+
options.projectPath = path3.resolve(resolvedConfig.root);
|
|
6185
|
+
;
|
|
6183
6186
|
if (_buildStarted) {
|
|
6184
6187
|
return;
|
|
6185
6188
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-uni-tailwind-processor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Vite插件:为uniapp项目适配tailwindcss的文件监听与样式处理",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"vite": "^4.0.0 || ^5.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@types/node": "^25.1.0",
|
|
25
26
|
"chokidar": "^3.5.3",
|
|
26
27
|
"tsup": "^8.0.0",
|
|
27
28
|
"typescript": "^5.0.0",
|