@tarojs/runner-utils 3.8.0-canary.0 → 4.0.0-beta.0
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/constant.js +5 -1
- package/dist/index.js +18 -9
- package/dist/vite.js +35 -0
- package/package.json +8 -2
- package/types/constant.d.ts +4 -0
- package/types/index.d.ts +4 -4
- package/types/vite.d.ts +5 -0
package/dist/constant.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_Components = void 0;
|
|
3
|
+
exports.MEDIA_LIMIT = exports.FONT_LIMIT = exports.IMAGE_LIMIT = exports.VITE_COMPILER_LABEL = exports.DEFAULT_Components = void 0;
|
|
4
4
|
exports.DEFAULT_Components = new Set([
|
|
5
5
|
'view',
|
|
6
6
|
'scroll-view',
|
|
@@ -46,3 +46,7 @@ exports.DEFAULT_Components = new Set([
|
|
|
46
46
|
'official-account',
|
|
47
47
|
'editor'
|
|
48
48
|
]);
|
|
49
|
+
exports.VITE_COMPILER_LABEL = 'taro:compiler';
|
|
50
|
+
exports.IMAGE_LIMIT = 2 * 1024;
|
|
51
|
+
exports.FONT_LIMIT = 10 * 1024;
|
|
52
|
+
exports.MEDIA_LIMIT = 10 * 1024;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "MultiPlatformPlugin", { enumerable: true, get: function () { return MultiPlatformPlugin_1.MultiPlatformPlugin; } });
|
|
8
|
-
const scss_1 = require("./scss");
|
|
9
|
-
Object.defineProperty(exports, "getBundleContent", { enumerable: true, get: function () { return scss_1.getBundleContent; } });
|
|
10
|
-
Object.defineProperty(exports, "getBundleResult", { enumerable: true, get: function () { return scss_1.getBundleResult; } });
|
|
11
|
-
Object.defineProperty(exports, "getSassLoaderOption", { enumerable: true, get: function () { return scss_1.getSassLoaderOption; } });
|
|
17
|
+
__exportStar(require("./constant"), exports);
|
|
18
|
+
__exportStar(require("./resolve/MultiPlatformPlugin"), exports);
|
|
19
|
+
__exportStar(require("./scss"), exports);
|
|
20
|
+
__exportStar(require("./vite"), exports);
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getViteMiniCompilerContext = exports.getViteHarmonyCompilerContext = exports.getViteH5CompilerContext = void 0;
|
|
13
|
+
const constant_1 = require("./constant");
|
|
14
|
+
function getViteH5CompilerContext(rollupPluginContext) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const info = process.env.NODE_ENV === 'production'
|
|
17
|
+
? rollupPluginContext.getModuleInfo(constant_1.VITE_COMPILER_LABEL)
|
|
18
|
+
: yield rollupPluginContext.load({ id: constant_1.VITE_COMPILER_LABEL });
|
|
19
|
+
const compiler = info === null || info === void 0 ? void 0 : info.meta.viteCompilerContext;
|
|
20
|
+
return compiler;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.getViteH5CompilerContext = getViteH5CompilerContext;
|
|
24
|
+
function getViteHarmonyCompilerContext(rollupPluginContext) {
|
|
25
|
+
const info = rollupPluginContext.getModuleInfo(constant_1.VITE_COMPILER_LABEL);
|
|
26
|
+
const compiler = info === null || info === void 0 ? void 0 : info.meta.viteCompilerContext;
|
|
27
|
+
return compiler;
|
|
28
|
+
}
|
|
29
|
+
exports.getViteHarmonyCompilerContext = getViteHarmonyCompilerContext;
|
|
30
|
+
function getViteMiniCompilerContext(rollupPluginContext) {
|
|
31
|
+
const info = rollupPluginContext.getModuleInfo(constant_1.VITE_COMPILER_LABEL);
|
|
32
|
+
const compiler = info === null || info === void 0 ? void 0 : info.meta.viteCompilerContext;
|
|
33
|
+
return compiler;
|
|
34
|
+
}
|
|
35
|
+
exports.getViteMiniCompilerContext = getViteMiniCompilerContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/runner-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "Taro runner utilities.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -19,7 +19,13 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"scss-bundle": "^3.0.2",
|
|
22
|
-
"@tarojs/
|
|
22
|
+
"@tarojs/taro": "4.0.0-beta.0",
|
|
23
|
+
"@tarojs/helper": "4.0.0-beta.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependenciesMeta": {
|
|
26
|
+
"rollup": {
|
|
27
|
+
"optional": true
|
|
28
|
+
}
|
|
23
29
|
},
|
|
24
30
|
"scripts": {
|
|
25
31
|
"build": "tsc",
|
package/types/constant.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
export * from './constant';
|
|
2
|
+
export * from './resolve/MultiPlatformPlugin';
|
|
3
|
+
export * from './scss';
|
|
4
|
+
export * from './vite';
|
package/types/vite.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ViteH5CompilerContext, ViteHarmonyCompilerContext, ViteMiniCompilerContext } from '@tarojs/taro/types/compile/viteCompilerContext';
|
|
2
|
+
import type { PluginContext } from 'rollup';
|
|
3
|
+
export declare function getViteH5CompilerContext(rollupPluginContext: PluginContext): Promise<ViteH5CompilerContext | void>;
|
|
4
|
+
export declare function getViteHarmonyCompilerContext(rollupPluginContext: PluginContext): ViteHarmonyCompilerContext | void;
|
|
5
|
+
export declare function getViteMiniCompilerContext(rollupPluginContext: PluginContext): ViteMiniCompilerContext | void;
|