655227f4e1
Reverts vercel/next.js#61832 Closes PACK-2654
132 lines
4.6 KiB
TOML
132 lines
4.6 KiB
TOML
[package]
|
|
edition = "2021"
|
|
name = "next-swc-napi"
|
|
version = "0.0.0"
|
|
publish = false
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[features]
|
|
# Instead of enabling all the plugin-related features by default, make it explicitly specified
|
|
# when build (i.e napi --build --features plugin), same for the wasm as well.
|
|
# this is due to some of transitive dependencies have features cannot be enabled at the same time
|
|
# (i.e wasmer/default vs wasmer/js-default) while cargo merges all the features at once.
|
|
plugin = [
|
|
"turbopack-binding/__swc_core_binding_napi_plugin",
|
|
"turbopack-binding/__swc_core_binding_napi_plugin_filesystem_cache",
|
|
"turbopack-binding/__swc_core_binding_napi_plugin_shared_runtime",
|
|
"next-custom-transforms/plugin",
|
|
"next-core/plugin",
|
|
]
|
|
|
|
image-webp = ["next-core/image-webp"]
|
|
image-avif = ["next-core/image-avif"]
|
|
# Enable all the available image codec support.
|
|
# Currently this is identical to `image-webp`, as we are not able to build
|
|
# other codecs easily yet.
|
|
image-extended = ["image-webp"]
|
|
|
|
# Enable dhat profiling allocator for heap profiling.
|
|
__internal_dhat-heap = ["dhat"]
|
|
# Enable dhat profiling allocator for ad hoc profiling.
|
|
# [Note]: we do not have any ad hoc event in the codebase yet, so enabling this
|
|
# effectively does nothing.
|
|
__internal_dhat-ad-hoc = ["dhat"]
|
|
|
|
# Making custom_allocator as default feature will break some targets (i.e aarch64-linux), controlling it with
|
|
# build-time cfg instead.
|
|
#
|
|
# [NOTE] this is a workaround to enable downstream features for the own pkgs, since
|
|
# cargo does not support per-target features enablement.
|
|
[target.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.dependencies]
|
|
turbopack-binding = { workspace = true, features = ["__turbo_tasks_malloc"] }
|
|
|
|
[target.'cfg(all(target_os = "linux", not(any(target_arch = "aarch64", target_arch = "wasm32"))))'.dependencies]
|
|
turbopack-binding = { workspace = true, features = ["__turbo_tasks_malloc", "__turbo_tasks_malloc_custom_allocator"] }
|
|
|
|
[target.'cfg(not(any(target_os = "linux", target_arch = "wasm32")))'.dependencies]
|
|
turbopack-binding = { workspace = true, features = ["__turbo_tasks_malloc", "__turbo_tasks_malloc_custom_allocator"] }
|
|
|
|
# Enable specific tls features per-target.
|
|
[target.'cfg(all(target_os = "windows", target_arch = "aarch64"))'.dependencies]
|
|
next-core = { workspace = true, features = ["native-tls"] }
|
|
|
|
[target.'cfg(not(any(all(target_os = "windows", target_arch = "aarch64"), target_arch="wasm32")))'.dependencies]
|
|
next-core = { workspace = true, features = ["rustls-tls"] }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.66"
|
|
backtrace = "0.3"
|
|
fxhash = "0.2.1"
|
|
dhat = { workspace = true, optional = true }
|
|
napi = { version = "2", default-features = false, features = [
|
|
"napi3",
|
|
"serde-json",
|
|
"tokio_rt",
|
|
"error_anyhow",
|
|
# Lightningcss uses this features
|
|
"napi4",
|
|
"napi5",
|
|
"compat-mode"
|
|
] }
|
|
napi-derive = "2"
|
|
next-custom-transforms = { workspace = true }
|
|
|
|
serde = "1"
|
|
serde_json = "1"
|
|
shadow-rs = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
tracing-chrome = "0.5.0"
|
|
url = {workspace = true}
|
|
urlencoding = {workspace = true}
|
|
|
|
# Dependencies for the native, non-wasm32 build.
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
lightningcss-napi = { workspace = true }
|
|
tokio = { workspace = true, features = ["full"] }
|
|
turbo-tasks = { workspace = true }
|
|
next-api = { workspace = true }
|
|
next-build = { workspace = true }
|
|
next-core = { workspace = true }
|
|
turbopack-binding = { workspace = true, features = [
|
|
"__swc_core_binding_napi",
|
|
"__swc_core_serde",
|
|
"__feature_node_file_trace",
|
|
"__feature_mdx_rs",
|
|
"__turbo",
|
|
"__turbo_tasks",
|
|
"__turbo_tasks_memory",
|
|
"__turbopack",
|
|
"__turbopack_ecmascript_hmr_protocol",
|
|
] }
|
|
|
|
# Dependencies for the wasm32 build.
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
getrandom = { version = "0.2.9", default-features = false, features = ["js"] }
|
|
iana-time-zone = { version = "*", features = ["fallback"] }
|
|
turbopack-binding = { workspace = true, features = [
|
|
"__swc_core_binding_napi",
|
|
"__swc_core_serde",
|
|
"__feature_mdx_rs",
|
|
] }
|
|
|
|
# wasi-only dependencies.
|
|
[target.wasm32-wasi-preview1-threads.dependencies]
|
|
# this requires tokio_unstable currently.
|
|
tokio = { workspace = true, features = ["full"] }
|
|
|
|
[build-dependencies]
|
|
napi-build = "2"
|
|
serde = "1"
|
|
serde_json = "1"
|
|
# It is not a mistake this dependency is specified in dep / build-dep both.
|
|
shadow-rs = { workspace = true }
|
|
|
|
# build-dependencies for the native, non-wasm32 build
|
|
[target.'cfg(not(target_arch = "wasm32"))'.build-dependencies]
|
|
turbopack-binding = { workspace = true, features = ["__turbo_tasks_build"] }
|