提交 3c7217e5 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 ed131ed4
[
{
"input": {
"temp/uni-ext-api/index.uts": "uni.api.ts"
"temp/uni-ext-api/index.uts": "uni.api.ets"
},
"alias": {
"@vue/shared": "<rootDir>/packages/uni-app-harmony/src/shared",
......@@ -21,36 +21,32 @@
"__APP_VIEW__": "false",
"__NODE_JS__": "false"
},
"banner":"import { IUniError, UTSObject, UTSJSONObject, string } from './uts'\nimport { defineAsyncApi } from './uni.api'",
"wrapper": {
"name": "initUniExtApi",
"args": [
["uniExtApi", "ESObject"],
["shared", "ESObject"],
["UTSJSONObject", "ESObject"],
["UTSJSONObject", "ESObject"]
]
}
},
{
"input": {
"src/service/index.ts": "uni.runtime.ts"
},
"alias": {
"@vue/shared": "<rootDir>/packages/uni-app-harmony/src/shared",
"@dcloudio/uni-api": "<rootDir>/packages/uni-api/src",
"@dcloudio/uni-app-plus": "<rootDir>/packages/uni-app-plus/src",
"@dcloudio/uni-components": "<rootDir>/packages/uni-components/src",
"@dcloudio/uni-core": "<rootDir>/packages/uni-core/src",
"@dcloudio/uni-i18n": "<rootDir>/packages/uni-i18n/src",
"@dcloudio/uni-platform": "<rootDir>/packages/uni-app-harmony/src/platform",
"@dcloudio/uni-shared": "<rootDir>/packages/uni-shared/src"
},
"replacements": {
"__PLATFORM__": "'app-harmony'",
"__DEV__": "false",
"__X__": "true",
"__APP_VIEW__": "false",
"__NODE_JS__": "false"
"args": [["APP_ID", "string"]]
}
}
// {
// "input": {
// "src/service/index.ts": "uni.runtime.ts"
// },
// "alias": {
// "@vue/shared": "<rootDir>/packages/uni-app-harmony/src/shared",
// "@dcloudio/uni-api": "<rootDir>/packages/uni-api/src",
// "@dcloudio/uni-app-plus": "<rootDir>/packages/uni-app-plus/src",
// "@dcloudio/uni-components": "<rootDir>/packages/uni-components/src",
// "@dcloudio/uni-core": "<rootDir>/packages/uni-core/src",
// "@dcloudio/uni-i18n": "<rootDir>/packages/uni-i18n/src",
// "@dcloudio/uni-platform": "<rootDir>/packages/uni-app-harmony/src/platform",
// "@dcloudio/uni-shared": "<rootDir>/packages/uni-shared/src"
// },
// "replacements": {
// "__PLATFORM__": "'app-harmony'",
// "__DEV__": "false",
// "__X__": "true",
// "__APP_VIEW__": "false",
// "__NODE_JS__": "false"
// }
// }
]
......@@ -1056,3 +1056,436 @@ uni-textarea[hidden] {
/* 用于重置iOS14以下禁用状态文字颜色 */
-webkit-text-fill-color: currentcolor;
}
uni-picker-view {
display: block;
}
.uni-picker-view-wrapper {
display: flex;
position: relative;
overflow: hidden;
height: 100%;
}
uni-picker-view[hidden] {
display: none;
}
uni-picker-view-column {
flex: 1;
position: relative;
height: 100%;
overflow: hidden;
}
uni-picker-view-column[hidden] {
display: none;
}
.uni-picker-view-group {
height: 100%;
overflow: hidden;
}
.uni-picker-view-mask {
transform: translateZ(0);
}
.uni-picker-view-indicator,
.uni-picker-view-mask {
position: absolute;
left: 0;
width: 100%;
z-index: 3;
pointer-events: none;
}
.uni-picker-view-mask {
top: 0;
height: 100%;
margin: 0 auto;
background-image: linear-gradient(
180deg,
hsla(0, 0%, 100%, 0.95),
hsla(0, 0%, 100%, 0.6)
),
linear-gradient(0deg, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6));
background-position: top, bottom;
background-size: 100% 102px;
background-repeat: no-repeat;
transform: translateZ(0);
}
.uni-picker-view-indicator {
height: 34px;
/* top: 102px; */
top: 50%;
transform: translateY(-50%);
}
.uni-picker-view-content {
position: absolute;
top: 0;
left: 0;
width: 100%;
will-change: transform;
padding: 102px 0;
cursor: pointer;
}
.uni-picker-view-content > * {
height: var(--picker-view-column-indicator-height);
overflow: hidden;
}
.uni-picker-view-indicator:after,
.uni-picker-view-indicator:before {
content: ' ';
position: absolute;
left: 0;
right: 0;
height: 1px;
color: #e5e5e5;
}
.uni-picker-view-indicator:before {
top: 0;
border-top: 1px solid #e5e5e5;
transform-origin: 0 0;
transform: scaleY(0.5);
}
.uni-picker-view-indicator:after {
bottom: 0;
border-bottom: 1px solid #e5e5e5;
transform-origin: 0 100%;
transform: scaleY(0.5);
}
.uni-picker-view-indicator:after,
.uni-picker-view-indicator:before {
content: ' ';
position: absolute;
left: 0;
right: 0;
height: 1px;
color: #e5e5e5;
}
@media (prefers-color-scheme: dark) {
.uni-picker-view-indicator:before {
border-top-color: var(--UI-FG-3);
}
.uni-picker-view-indicator:after {
border-bottom-color: var(--UI-FG-3);
}
.uni-picker-view-mask {
background-image: linear-gradient(
180deg,
rgba(35, 35, 35, 0.95),
rgba(35, 35, 35, 0.6)
),
linear-gradient(0deg, rgba(35, 35, 35, 0.95), rgba(35, 35, 35, 0.6));
}
}
uni-scroll-view {
display: block;
width: 100%;
}
uni-scroll-view[hidden] {
display: none;
}
.uni-scroll-view {
position: relative;
-webkit-overflow-scrolling: touch;
width: 100%;
/* display: flex; 时在安卓下会导致scrollWidth和offsetWidth一样 */
height: 100%;
max-height: inherit;
}
.uni-scroll-view-scrollbar-hidden::-webkit-scrollbar {
display: none;
}
.uni-scroll-view-scrollbar-hidden {
-moz-scrollbars: none;
scrollbar-width: none;
}
.uni-scroll-view-content {
width: 100%;
height: 100%;
}.uni-scroll-view-refresher {
position: relative;
overflow: hidden;
flex-shrink: 0;
}
.uni-scroll-view-refresher-container {
position: absolute;
width: 100%;
bottom: 0;
display: flex;
flex-direction: column-reverse;
}
.uni-scroll-view-refresh {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-scroll-view-refresh-inner {
display: flex;
align-items: center;
justify-content: center;
line-height: 0;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: #fff;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.117647),
0 1px 4px rgba(0, 0, 0, 0.117647);
}
.uni-scroll-view-refresh__spinner {
transform-origin: center center;
animation: uni-scroll-view-refresh-rotate 2s linear infinite;
}
.uni-scroll-view-refresh__spinner > circle {
stroke: currentColor;
stroke-linecap: round;
animation: uni-scroll-view-refresh-dash 2s linear infinite;
}
@keyframes uni-scroll-view-refresh-rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes uni-scroll-view-refresh-dash {
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89, 200;
stroke-dashoffset: -35px;
}
100% {
stroke-dasharray: 89, 200;
stroke-dashoffset: -124px;
}
}
uni-swiper {
display: block;
height: 150px;
}
uni-swiper[hidden] {
display: none;
}
.uni-swiper-wrapper {
overflow: hidden;
position: relative;
width: 100%;
height: 100%;
transform: translateZ(0);
}
.uni-swiper-slides {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.uni-swiper-slide-frame {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
will-change: transform;
}
.uni-swiper-dots {
position: absolute;
font-size: 0;
}
.uni-swiper-dots-horizontal {
left: 50%;
bottom: 10px;
text-align: center;
white-space: nowrap;
transform: translate(-50%, 0);
}
.uni-swiper-dots-horizontal .uni-swiper-dot {
margin-right: 8px;
}
.uni-swiper-dots-horizontal .uni-swiper-dot:last-child {
margin-right: 0;
}
.uni-swiper-dots-vertical {
right: 10px;
top: 50%;
text-align: right;
transform: translate(0, -50%);
}
.uni-swiper-dots-vertical .uni-swiper-dot {
display: block;
margin-bottom: 9px;
}
.uni-swiper-dots-vertical .uni-swiper-dot:last-child {
margin-bottom: 0;
}
.uni-swiper-dot {
display: inline-block;
width: 8px;
height: 8px;
cursor: pointer;
transition-property: background-color;
transition-timing-function: ease;
background: rgba(0, 0, 0, 0.3);
border-radius: 50%;
}
.uni-swiper-dot-active {
background-color: #000000;
}
.uni-swiper-navigation {
width: 26px;
height: 26px;
cursor: pointer;
position: absolute;
top: 50%;
margin-top: -13px;
display: flex;
align-items: center;
transition: all 0.2s;
border-radius: 50%;
opacity: 1;
}
.uni-swiper-navigation-disabled {
opacity: 0.35;
cursor: not-allowed;
}
.uni-swiper-navigation-hide {
opacity: 0;
cursor: auto;
pointer-events: none;
}
.uni-swiper-navigation-prev {
left: 10px;
}
.uni-swiper-navigation-prev svg {
margin-left: -1px;
left: 10px;
}
.uni-swiper-navigation-prev.uni-swiper-navigation-vertical {
top: 18px;
left: 50%;
margin-left: -13px;
}
.uni-swiper-navigation-prev.uni-swiper-navigation-vertical svg {
transform: rotate(90deg);
margin-left: auto;
margin-top: -2px;
}
.uni-swiper-navigation-next {
right: 10px;
}
.uni-swiper-navigation-next svg {
transform: rotate(180deg);
}
.uni-swiper-navigation-next.uni-swiper-navigation-vertical {
top: auto;
bottom: 5px;
left: 50%;
margin-left: -13px;
}
.uni-swiper-navigation-next.uni-swiper-navigation-vertical svg {
margin-top: 2px;
transform: rotate(270deg);
}
uni-swiper-item {
display: block;
overflow: hidden;
will-change: transform;
position: absolute;
width: 100%;
height: 100%;
cursor: grab;
}
uni-swiper-item[hidden] {
display: none;
}
uni-movable-area {
display: block;
position: relative;
width: 10px;
height: 10px;
}
uni-movable-area[hidden] {
display: none;
}
uni-movable-view {
display: inline-block;
width: 10px;
height: 10px;
top: 0px;
left: 0px;
position: absolute;
cursor: grab;
}
uni-movable-view[hidden] {
display: none;
}
uni-icon {
display: inline-block;
font-size: 0;
box-sizing: border-box;
}
uni-icon[hidden] {
display: none;
}
import { IUniError, UTSObject, UTSJSONObject, string } from './uts'
import { defineAsyncApi } from './uni.api'
import picker from '@ohos.file.picker';
import image from '@ohos.multimedia.image';
import media from '@ohos.multimedia.media';
import fs from '@ohos.file.fs';
import picker1 from '@ohos.file.picker';
import picker2 from '@ohos.file.picker';
export function initUniExtApi(uniExtApi: ESObject, shared: ESObject, UTSJSONObject: ESObject, UTSJSONObject: ESObject) {
export { MediaOrientation as MediaOrientation };
export { MediaErrorCode as MediaErrorCode };
export { IMediaError as IMediaError };
export { ChooseImageSuccess as ChooseImageSuccess };
export { ChooseImageFail as ChooseImageFail };
export { ChooseImageSuccessCallback as ChooseImageSuccessCallback };
export { ChooseImageFailCallback as ChooseImageFailCallback };
export { ChooseImageCompleteCallback as ChooseImageCompleteCallback };
export { ChooseImageCropOptions as ChooseImageCropOptions };
export { ChooseImageOptions as ChooseImageOptions };
export { ChooseImage as ChooseImage };
export { PreviewImageSuccess as PreviewImageSuccess };
export { LongPressActionsSuccessData as LongPressActionsSuccessData };
export { LongPressActionsOptions as LongPressActionsOptions };
export { PreviewImageFail as PreviewImageFail };
export { PreviewImageSuccessCallback as PreviewImageSuccessCallback };
export { PreviewImageFailCallback as PreviewImageFailCallback };
export { PreviewImageCompleteCallback as PreviewImageCompleteCallback };
export { PreviewImageOptions as PreviewImageOptions };
export { PreviewImage as PreviewImage };
export { ClosePreviewImage as ClosePreviewImage };
export { ClosePreviewImageSuccess as ClosePreviewImageSuccess };
export { ClosePreviewImageFail as ClosePreviewImageFail };
export { ClosePreviewImageSuccessCallback as ClosePreviewImageSuccessCallback };
export { ClosePreviewImageFailCallback as ClosePreviewImageFailCallback };
export { ClosePreviewImageCompleteCallback as ClosePreviewImageCompleteCallback };
export { ClosePreviewImageOptions as ClosePreviewImageOptions };
export { GetImageInfo as GetImageInfo };
export { GetImageInfoSuccess as GetImageInfoSuccess };
export { GetImageInfoFail as GetImageInfoFail };
export { GetImageInfoSuccessCallback as GetImageInfoSuccessCallback };
export { GetImageInfoFailCallback as GetImageInfoFailCallback };
export { GetImageInfoCompleteCallback as GetImageInfoCompleteCallback };
export { GetImageInfoOptions as GetImageInfoOptions };
export { SaveImageToPhotosAlbum as SaveImageToPhotosAlbum };
export { SaveImageToPhotosAlbumSuccess as SaveImageToPhotosAlbumSuccess };
export { SaveImageToPhotosAlbumFail as SaveImageToPhotosAlbumFail };
export { SaveImageToPhotosAlbumSuccessCallback as SaveImageToPhotosAlbumSuccessCallback };
export { SaveImageToPhotosAlbumFailCallback as SaveImageToPhotosAlbumFailCallback };
export { SaveImageToPhotosAlbumCompleteCallback as SaveImageToPhotosAlbumCompleteCallback };
export { SaveImageToPhotosAlbumOptions as SaveImageToPhotosAlbumOptions };
export { CompressImage as CompressImage };
export { CompressImageSuccess as CompressImageSuccess };
export { CompressImageFail as CompressImageFail };
export { CompressImageSuccessCallback as CompressImageSuccessCallback };
export { CompressImageFailCallback as CompressImageFailCallback };
export { CompressImageCompleteCallback as CompressImageCompleteCallback };
export { CompressImageOptions as CompressImageOptions };
export { ChooseVideoSuccess as ChooseVideoSuccess };
export { ChooseVideoFail as ChooseVideoFail };
export { ChooseVideoSuccessCallback as ChooseVideoSuccessCallback };
export { ChooseVideoFailCallback as ChooseVideoFailCallback };
export { ChooseVideoCompleteCallback as ChooseVideoCompleteCallback };
export { ChooseVideoOptions as ChooseVideoOptions };
export { ChooseVideo as ChooseVideo };
export { GetVideoInfoSuccess as GetVideoInfoSuccess };
export { GetVideoInfoFail as GetVideoInfoFail };
export { GetVideoInfoSuccessCallback as GetVideoInfoSuccessCallback };
export { GetVideoInfoFailCallback as GetVideoInfoFailCallback };
export { GetVideoInfoCompleteCallback as GetVideoInfoCompleteCallback };
export { GetVideoInfoOptions as GetVideoInfoOptions };
export { GetVideoInfo as GetVideoInfo };
export { SaveVideoToPhotosAlbumSuccess as SaveVideoToPhotosAlbumSuccess };
export { SaveVideoToPhotosAlbumFail as SaveVideoToPhotosAlbumFail };
export { SaveVideoToPhotosAlbumSuccessCallback as SaveVideoToPhotosAlbumSuccessCallback };
export { SaveVideoToPhotosAlbumFailCallback as SaveVideoToPhotosAlbumFailCallback };
export { SaveVideoToPhotosAlbumCompleteCallback as SaveVideoToPhotosAlbumCompleteCallback };
export { SaveVideoToPhotosAlbumOptions as SaveVideoToPhotosAlbumOptions };
export { SaveVideoToPhotosAlbum as SaveVideoToPhotosAlbum };
export { CompressVideoSuccess as CompressVideoSuccess };
export { CompressVideoFail as CompressVideoFail };
export { CompressVideoSuccessCallback as CompressVideoSuccessCallback };
export { CompressVideoFailCallback as CompressVideoFailCallback };
export { CompressVideoCompleteCallback as CompressVideoCompleteCallback };
export { CompressVideoOptions as CompressVideoOptions };
export { CompressVideo as CompressVideo };
export { Uni as Uni };
export { chooseImage as chooseImage, chooseVideo as chooseVideo, getImageInfo as getImageInfo, getVideoInfo as getVideoInfo };
export { default as default };
export function initUniExtApi(APP_ID: string) {
const API_CHOOSE_IMAGE = 'chooseImage';
const API_CHOOSE_VIDEO = 'chooseVideo';
const API_GET_IMAGE_INFO = 'getImageInfo';
......@@ -240,7 +321,7 @@ export function initUniExtApi(uniExtApi: ESObject, shared: ESObject, UTSJSONObje
fileType: 'image',
tempFilePath: uri,
size: stat.size
};
} as MediaFile;
})
};
}
......@@ -255,27 +336,29 @@ export function initUniExtApi(uniExtApi: ESObject, shared: ESObject, UTSJSONObje
duration: videoInfo.duration,
width: videoInfo.width,
height: videoInfo.height
} as UTSJSONObject);
} as MediaFile);
}
return {
tempFiles
};
};
const chooseImage: ChooseImage = defineAsyncApi(API_CHOOSE_IMAGE, (params: ChooseMediaOptions, ref)=>{
const chooseImage: ChooseImage = defineAsyncApi(API_CHOOSE_IMAGE, (params, ref)=>{
let resolve = ref.resolve, reject = ref.reject;
_chooseMedia({
mimeType: picker1.PhotoViewMIMETypes.IMAGE_TYPE,
count: params.count
} as ChooseMediaOptions).then((res)=>{
return {
errSubject: 'chooseImage',
errMsg: 'chooseImage:ok',
tempFilePaths: res.tempFiles.map((file)=>file.tempFilePath),
tempFiles: res.tempFiles.map((file)=>{
return {
path: file.tempFilePath,
size: file.size
};
} as UTSJSONObject;
})
};
} as ChooseImageSuccess;
}).then(resolve, reject);
});
const chooseVideo: ChooseVideo = defineAsyncApi(API_CHOOSE_VIDEO, (_, ref)=>{
......@@ -290,7 +373,7 @@ export function initUniExtApi(uniExtApi: ESObject, shared: ESObject, UTSJSONObje
size: file.size,
width: file.width,
height: file.height
};
} as ChooseVideoSuccess;
}).then(resolve, reject);
});
const getImageInfo: GetImageInfo = defineAsyncApi(API_GET_IMAGE_INFO, (ref: GetImageInfoOptions, ref1)=>{
......@@ -307,11 +390,19 @@ export function initUniExtApi(uniExtApi: ESObject, shared: ESObject, UTSJSONObje
height: res.height!,
type: res.type!,
orientation: res.orientation!
};
} as GetVideoInfoSuccess;
}).then(resolve, reject);
});
uniExtApi.chooseImage = chooseImage;
uniExtApi.getImageInfo = getImageInfo;
uniExtApi.chooseVideo = chooseVideo;
uniExtApi.getVideoInfo = getVideoInfo;
interface UniExtApi {
chooseImage: ChooseImage;
getImageInfo: GetImageInfo;
chooseVideo: ChooseVideo;
getVideoInfo: GetVideoInfo;
}
const default = {
chooseImage,
getImageInfo,
chooseVideo,
getVideoInfo
} as UniExtApi;
}
此差异已折叠。
......@@ -9,7 +9,7 @@ import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import babel from '@rollup/plugin-babel'
import { cssTarget, parseInjects } from '@dcloudio/uni-cli-shared'
import { capitalize, cssTarget, parseInjects } from '@dcloudio/uni-cli-shared'
import { isH5CustomElement } from '@dcloudio/uni-shared'
import { resolveExtApiTempDir } from '../../scripts/ext-api'
......@@ -197,9 +197,10 @@ function initArkTSExtApi() {
// 遍历所有 ext-api,查找已实现 app-harmony 的 ext-api
const extApiDir = path.resolve(process.env.UNI_APP_EXT_API_DIR)
const extApiTempDir = resolveExtApiTempDir('uni-app-harmony')
const extApis: string[] = []
const importExtApis: string[] = []
const exportExtApis: string[] = []
const defineExtApis: string[] = []
const uniExtApis: string[] = []
for (const extApi of fs.readdirSync(extApiDir)) {
const extApiPath = path.resolve(extApiDir, extApi)
if (
......@@ -215,15 +216,21 @@ function initArkTSExtApi() {
}
const specifiers: string[] = []
Object.keys(injects).forEach((key) => {
const local = key.replace(/\./g, '_')
specifiers.push(`${injects[key][1]} as ${local}`)
defineExtApis.push(`${key.replace('uni.', 'uniExtApi.')} = ${local}`)
const api = injects[key][1]
const apiType = capitalize(api)
specifiers.push(api)
specifiers.push(apiType)
defineExtApis.push(api)
uniExtApis.push(`${api}: ${apiType}`)
})
importExtApis.push(
`import { ${specifiers.join(
', '
)} } from './${extApi}/utssdk/app-harmony/index.uts'`
)
exportExtApis.push(
`export * from './${extApi}/utssdk/app-harmony/index.uts'`
)
fs.copySync(extApiPath, path.resolve(extApiTempDir, extApi))
}
......@@ -232,6 +239,12 @@ function initArkTSExtApi() {
fs.writeFileSync(
extApiIndex,
`${importExtApis.join('\n')}
${defineExtApis.join('\n')}`
${exportExtApis.join('\n')}
interface UniExtApi {
${uniExtApis.join(',\n ')}
}
export default {
${defineExtApis.join(',\n ')}
} as UniExtApi`
)
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`uts:stacktrace:runtime parseUTSJavaScriptRuntimeStacktrace 1`] = `
"error: ReferenceError:Can't find variable: a
"error: [EXCEPTION] ReferenceError:Can't find variable: a
at pages/index/index.uvue:3:8
1 | <script lang="uts">
2 | setTimeout(() => {
......@@ -12,7 +12,7 @@ at pages/index/index.uvue:3:8
`;
exports[`uts:stacktrace:runtime parseUTSJavaScriptRuntimeStacktrace 2`] = `
"error: at <Index __pageId=1 __pagePath="pages/index/index" __pageQuery= ... >
"error: [EXCEPTION] at <Index __pageId=1 __pagePath="pages/index/index" __pageQuery= ... >
Can't find variable: a
at pages/index/index.uvue:7:12
5 | export default {
......
......@@ -51,7 +51,7 @@ export function parseUTSJavaScriptRuntimeStacktrace(
: ''
let error =
`error: ${res[0].includes('[EXCEPTION] ') ? '' : '[EXCEPTION] '}` +
+res[0]
res[0]
if (color) {
error = color + error + color
}
......
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
overrides:
'@babel/plugin-transform-block-scoping': 7.19.4
......@@ -130,6 +134,9 @@ importers:
jest:
specifier: ^29.3.1
version: 29.7.0(@types/node@18.19.31)
jsonc-parser:
specifier: ^3.2.0
version: 3.2.1
lint-staged:
specifier: ^10.5.3
version: 10.5.4
......@@ -11646,7 +11653,3 @@ packages:
optionalDependencies:
commander: 9.5.0
dev: true
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
......@@ -3,7 +3,7 @@ const path = require('path')
const colors = require('picocolors')
const execa = require('execa')
const { spawn } = require('child_process')
const { parse } = require('jsonc-parser')
const { config } = require('dotenv')
config()
......@@ -233,7 +233,7 @@ async function build(target) {
}
}
if (hasArkTSBundler) {
await buildArkTS(target, require(path.resolve(pkgDir, 'build.ets.json')))
await buildArkTS(target, parse(fs.readFileSync(path.resolve(pkgDir, 'build.ets.json'), 'utf8')))
}
}
......@@ -304,6 +304,10 @@ async function buildArkTS(target, buildJson) {
await bundleArkTS(buildOptions).then((res) => {
console.log('bundle: ' + (Date.now() - start) + 'ms')
console.log(JSON.stringify(res))
if (options.banner) {
const filePath = path.resolve(buildOptions.output.outDir, buildOptions.output.outFilename)
fs.writeFileSync(filePath, options.banner + '\n' + fs.readFileSync(filePath, 'utf8'))
}
})
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册