This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 337
Allow non-Webpack Workers Sites #1833
Merged
xortive
merged 3 commits into
cloudflare:custom-builds-rc
from
GregBrimble:custom-builds-rc
Apr 9, 2021
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,14 @@ pub fn build( | |
} | ||
} | ||
|
||
if let Some(asset_manifest) = asset_manifest { | ||
log::info!("adding __STATIC_CONTENT_MANIFEST"); | ||
let binding = "__STATIC_CONTENT_MANIFEST".to_string(); | ||
let asset_manifest_blob = get_asset_manifest_blob(asset_manifest)?; | ||
let text_blob = TextBlob::new(asset_manifest_blob, binding)?; | ||
text_blobs.push(text_blob); | ||
} | ||
|
||
match target_type { | ||
TargetType::Rust => { | ||
log::info!("Rust project detected. Publishing..."); | ||
|
@@ -89,7 +97,7 @@ pub fn build( | |
log::info!("Plain JavaScript project detected. Publishing..."); | ||
let package_dir = target.package_dir()?; | ||
let package = Package::new(&package_dir)?; | ||
let script_path = package.main(&package_dir)?; | ||
let script_path = package_dir.join(package.main(&package_dir)?); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the change here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without it, So yes, it's needed, otherwise wrangler can't find that script to deploy. |
||
|
||
let assets = ServiceWorkerAssets::new( | ||
script_path, | ||
|
@@ -185,14 +193,6 @@ pub fn build( | |
wasm_modules.push(wasm_module); | ||
} | ||
|
||
if let Some(asset_manifest) = asset_manifest { | ||
log::info!("adding __STATIC_CONTENT_MANIFEST"); | ||
let binding = "__STATIC_CONTENT_MANIFEST".to_string(); | ||
let asset_manifest_blob = get_asset_manifest_blob(asset_manifest)?; | ||
let text_blob = TextBlob::new(asset_manifest_blob, binding)?; | ||
text_blobs.push(text_blob); | ||
} | ||
|
||
let assets = ServiceWorkerAssets::new( | ||
script_path, | ||
wasm_modules, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top level is correct -- we don't let you override target_type in environments