Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/late-moles-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farmfe/plugin-worker": patch
---

Fix invalid worker output extension
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"beige-eyes-repeat",
"blue-crabs-fail",
"brown-turkeys-clean",
"late-moles-decide",
"tender-cats-swim"
]
}
6 changes: 6 additions & 0 deletions rust-plugins/worker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @farmfe/plugin-worker

## 2.0.0-beta.1

### Patch Changes

- Fix invalid worker output extension

## 2.0.0-beta.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion rust-plugins/worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@farmfe/plugin-worker",
"version": "2.0.0-beta.0",
"version": "2.0.0-beta.1",
"main": "scripts/index.js",
"types": "scripts/index.d.ts",
"type": "module",
Expand Down
8 changes: 4 additions & 4 deletions rust-plugins/worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use farmfe_compiler::Compiler;
use farmfe_core::{
cache_item,
config::{
persistent_cache::PersistentCacheConfig,
Config, ModuleFormat, ModuleFormatConfig, OutputConfig, TargetEnv,
persistent_cache::PersistentCacheConfig, Config, ModuleFormat, ModuleFormatConfig,
OutputConfig, TargetEnv,
},
context::{CompilationContext, EmitFileParams},
deserialize,
Expand Down Expand Up @@ -76,6 +76,7 @@ fn build_worker(
persistent_cache: Box::new(PersistentCacheConfig::Bool(false)),
output: Box::new(OutputConfig {
target_env: TargetEnv::Library,
entry_filename: full_file_name.clone(),
..*compiler_config.output.clone()
}),
lazy_compilation: false,
Expand All @@ -87,8 +88,7 @@ fn build_worker(
.unwrap();
compiler.compile().unwrap();
let resources_map = compiler.context().resources_map.lock();
let resource_name = format!("{}.mjs", full_file_name);
let resource = resources_map.get(&resource_name).unwrap();
let resource = resources_map.get(&full_file_name).unwrap();
let content_bytes = resource.bytes.clone();
content_bytes
}
Expand Down
Loading