代码拉取完成,页面将自动刷新
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import { getWasmJSContent } from './esbuild.base.mjs';
const isCI = process.env.CI === "true";
function WasmPlugin() {
return {
name: 'wasm-plugin',
resolveId: (source, importer) =>
source.endsWith('.wasm') ?
path.resolve(path.dirname(importer), source) :
null,
load: (id) => id.endsWith('.wasm') ?
getWasmJSContent(id) :
null,
};
}
const testConfig = {
setupFiles: ['./tests/setup.ts'],
reporters: ['verbose'],
coverage: {
provider: 'istanbul',
reporter: isCI ? ['json-summary', 'lcov'] : ['json-summary', "html"],
thresholds: {
"branches": 63,
"functions": 75,
"lines": 75,
"statements": 75
},
include: [
'src'
],
exclude: [
'src/castor/protos',
'src/domain/models/errors'
]
},
}
export default defineConfig({
plugins: [
WasmPlugin(),
],
resolve: {
extensions: ['.ts', '.js', '.wasm'],
mainFields: ['module', 'main'],
},
test: {
...testConfig,
environment: 'jsdom',
include: ['tests/**/*.test.ts'],
},
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。