mirror of
https://github.com/swc-project/swc.git
synced 2024-11-26 20:36:17 +03:00
refactor(es): Prepare wasm32-wasi-preview1-threads
target support (#8724)
This commit is contained in:
parent
e25380451e
commit
e3acd1476c
@ -63,5 +63,5 @@ swc_core = { version = "0.90.18", features = [
|
||||
"ecma_visit",
|
||||
"base_node",
|
||||
"base_concurrent",
|
||||
] }
|
||||
]}
|
||||
swc_malloc = "0.5.10"
|
||||
|
@ -138,7 +138,7 @@ pub struct Options {
|
||||
#[serde(skip_deserializing, default)]
|
||||
pub unresolved_mark: Option<Mark>,
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))]
|
||||
#[serde(default = "default_cwd")]
|
||||
pub cwd: PathBuf,
|
||||
|
||||
@ -160,7 +160,7 @@ pub struct Options {
|
||||
#[serde(default = "default_swcrc")]
|
||||
pub swcrc: bool,
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))]
|
||||
#[serde(default)]
|
||||
pub swcrc_roots: Option<PathBuf>,
|
||||
|
||||
@ -821,7 +821,7 @@ pub struct CallerOptions {
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))]
|
||||
fn default_cwd() -> PathBuf {
|
||||
::std::env::current_dir().unwrap()
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ impl Scope {
|
||||
|
||||
#[cfg(feature = "concurrent-renamer")]
|
||||
if parallel {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))]
|
||||
let iter = self.children.par_iter_mut();
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let iter = self.children.iter_mut();
|
||||
|
@ -117,7 +117,7 @@ where
|
||||
}
|
||||
|
||||
pub fn with_config(resolver: R, config: Config) -> Self {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))]
|
||||
if let Some(base_dir) = &config.base_dir {
|
||||
assert!(
|
||||
base_dir.is_absolute(),
|
||||
|
@ -93,7 +93,7 @@
|
||||
"@babel/preset-react": "^7.13.13",
|
||||
"@babel/preset-typescript": "^7.13.0",
|
||||
"@babel/types": "^7.14.0",
|
||||
"@napi-rs/cli": "^3.0.0-alpha.22",
|
||||
"@napi-rs/cli": "^3.0.0-alpha.43",
|
||||
"@swc/core": "=1.2.220",
|
||||
"@swc/helpers": "^0.5.0",
|
||||
"@swc/plugin-jest": "^1.5.117",
|
||||
@ -167,7 +167,7 @@
|
||||
"postinstall.js",
|
||||
"bindings/binding_core_wasm/pkg/binding_core_wasm.d.ts"
|
||||
],
|
||||
"packageManager": "yarn@4.0.2",
|
||||
"packageManager": "yarn@4.1.1",
|
||||
"dependencies": {
|
||||
"@swc/counter": "^0.1.2",
|
||||
"@swc/types": "^0.1.5"
|
||||
|
Loading…
Reference in New Issue
Block a user