summaryrefslogtreecommitdiff
path: root/cli/ast/bundle_hook.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2021-09-08 14:05:34 +1000
committerGitHub <noreply@github.com>2021-09-08 14:05:34 +1000
commitbf6dbf9855cb21d27838c56932c7536c0cd80a55 (patch)
tree2a175ada4300064d0b6f54b20f475f6bc436a8c3 /cli/ast/bundle_hook.rs
parent48331030111e9d346f054156fe24bc600a57e100 (diff)
fix(cli): better handling of source maps (#11954)
Ref: #11874
Diffstat (limited to 'cli/ast/bundle_hook.rs')
-rw-r--r--cli/ast/bundle_hook.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/cli/ast/bundle_hook.rs b/cli/ast/bundle_hook.rs
index 8e5b56c32..6b29bd8dd 100644
--- a/cli/ast/bundle_hook.rs
+++ b/cli/ast/bundle_hook.rs
@@ -14,18 +14,12 @@ impl Hook for BundleHook {
) -> Result<Vec<deno_ast::swc::ast::KeyValueProp>, AnyError> {
use deno_ast::swc::ast;
- // we use custom file names, and swc "wraps" these in `<` and `>` so, we
- // want to strip those back out.
- let mut value = module_record.file_name.to_string();
- value.pop();
- value.remove(0);
-
Ok(vec![
ast::KeyValueProp {
key: ast::PropName::Ident(ast::Ident::new("url".into(), span)),
value: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str {
span,
- value: value.into(),
+ value: module_record.file_name.to_string().into(),
kind: ast::StrKind::Synthesized,
has_escape: false,
}))),