@dcloudio/uni-cli-shared 3.0.0-alpha-3090820231116002 → 3.0.0-alpha-3090820231120001
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.
|
@@ -30,7 +30,9 @@ export declare const isDirectCSSRequest: (request: string) => boolean;
|
|
|
30
30
|
/**
|
|
31
31
|
* Plugin applied before user plugins
|
|
32
32
|
*/
|
|
33
|
-
export declare function cssPlugin(config: ResolvedConfig
|
|
33
|
+
export declare function cssPlugin(config: ResolvedConfig, options?: {
|
|
34
|
+
isAppX: boolean;
|
|
35
|
+
}): Plugin;
|
|
34
36
|
/**
|
|
35
37
|
* Plugin applied after user plugins
|
|
36
38
|
*/
|
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.hoistAtRules = exports.minifyCSS = exports.importCssRE = exports.cssDataUriRE = exports.cssUrlRE = exports.formatPostcssSourceMap = exports.cssPostPlugin = exports.cssPlugin = exports.isDirectCSSRequest = exports.isCSSRequest = exports.commonjsProxyRE = exports.cssLangRE = void 0;
|
|
30
|
-
const
|
|
30
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
31
31
|
const path_1 = __importDefault(require("path"));
|
|
32
32
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
33
33
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
@@ -57,7 +57,7 @@ const postcssConfigCache = new WeakMap();
|
|
|
57
57
|
/**
|
|
58
58
|
* Plugin applied before user plugins
|
|
59
59
|
*/
|
|
60
|
-
function cssPlugin(config) {
|
|
60
|
+
function cssPlugin(config, options) {
|
|
61
61
|
let server;
|
|
62
62
|
let moduleCache;
|
|
63
63
|
const resolveUrl = config.createResolver({
|
|
@@ -87,7 +87,14 @@ function cssPlugin(config) {
|
|
|
87
87
|
}
|
|
88
88
|
const resolved = await resolveUrl(url, importer);
|
|
89
89
|
if (resolved) {
|
|
90
|
-
return (0, asset_1.fileToUrl)(resolved, config,
|
|
90
|
+
return (0, asset_1.fileToUrl)(resolved, config, options?.isAppX
|
|
91
|
+
? {
|
|
92
|
+
emitFile(emittedFile) {
|
|
93
|
+
// 直接写入目标目录
|
|
94
|
+
fs_extra_1.default.outputFileSync(path_1.default.resolve(process.env.UNI_OUTPUT_DIR, emittedFile.fileName), emittedFile.source);
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
: this, true);
|
|
91
98
|
}
|
|
92
99
|
return url;
|
|
93
100
|
};
|
|
@@ -843,7 +850,7 @@ function preprocessCss(content, isNVue = false) {
|
|
|
843
850
|
async function rebaseUrls(file, rootFile, alias, isNVue = false) {
|
|
844
851
|
file = path_1.default.resolve(file); // ensure os-specific flashes
|
|
845
852
|
// fixed by xxxxxx 条件编译
|
|
846
|
-
let contents = preprocessCss(
|
|
853
|
+
let contents = preprocessCss(fs_extra_1.default.readFileSync(file, 'utf-8'), isNVue);
|
|
847
854
|
// in the same dir, no need to rebase
|
|
848
855
|
const fileDir = path_1.default.dirname(file);
|
|
849
856
|
const rootDir = path_1.default.dirname(rootFile);
|
|
@@ -960,7 +967,7 @@ function createViteLessPlugin(less, rootFile, alias, resolvers, isNVue) {
|
|
|
960
967
|
contents = result.contents;
|
|
961
968
|
}
|
|
962
969
|
else {
|
|
963
|
-
contents =
|
|
970
|
+
contents = fs_extra_1.default.readFileSync(resolved, 'utf-8');
|
|
964
971
|
}
|
|
965
972
|
return {
|
|
966
973
|
filename: path_1.default.resolve(resolved),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3090820231120001",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@babel/core": "^7.21.3",
|
|
26
26
|
"@babel/parser": "^7.16.4",
|
|
27
27
|
"@babel/types": "^7.20.7",
|
|
28
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
29
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
28
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3090820231120001",
|
|
29
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3090820231120001",
|
|
30
30
|
"@intlify/core-base": "9.1.9",
|
|
31
31
|
"@intlify/shared": "9.1.9",
|
|
32
32
|
"@intlify/vue-devtools": "9.1.9",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@dcloudio/uni-uts-v1": "3.0.0-alpha-
|
|
67
|
+
"@dcloudio/uni-uts-v1": "3.0.0-alpha-3090820231120001",
|
|
68
68
|
"@types/babel__core": "^7.1.19",
|
|
69
69
|
"@types/debug": "^4.1.7",
|
|
70
70
|
"@types/estree": "^0.0.51",
|