Skip to main content

Target Specs

This array includes target-specific configuration. Each entry filters by any combination of platform, arch, runtime, buildType, and runtimeEnv, and applies its specs block to every build target that matches the filter. Omit a field to match all of its values.

Here is a minimal example:

export default {
targetSpecs: [
{
platform: 'wasm',
specs: {
ignoreLibName: ['charset'],
},
},
{
platform: 'android',
specs: {
data: {
'share/proj': 'proj',
},
env: {
PROJ_LIB: '_CPPJS_DATA_PATH_/proj',
},
},
},
],
paths: {
config: import.meta.url,
},
};

Filter Fields

FieldAllowed values
platformwasm, android, ios
archwasm32, wasm64, arm64-v8a, x86_64, iphoneos, iphonesimulator
runtimest, mt
buildTyperelease, debug
runtimeEnvbrowser, edge, node (only meaningful when platform === 'wasm')

Spec Sub-Attributes

NameTypeDescription
dataobjectCopy local file to platform. key: local path, value: target path
envobjectSet environment variables
ignoreLibNamearrayLibraries not included in the linked project

tip

Below are examples demonstrating various uses of the configurations.