Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
06348522
Unverified
Commit
06348522
authored
Sep 05, 2019
by
Jonah Williams
Committed by
GitHub
Sep 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for mangled web sdk source map packages (#39774)
parent
64424a6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
web_fs.dart
packages/flutter_tools/lib/src/build_runner/web_fs.dart
+18
-1
No files found.
packages/flutter_tools/lib/src/build_runner/web_fs.dart
View file @
06348522
...
...
@@ -262,7 +262,7 @@ class WebFs {
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
'Content-Type'
:
'text/javascript'
,
});
}
else
if
(
request
.
url
.
path
.
contains
(
'dart_sdk
'
))
{
}
else
if
(
request
.
url
.
path
.
endsWith
(
'dart_sdk.js
'
))
{
final
File
file
=
fs
.
file
(
fs
.
path
.
join
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
),
'kernel'
,
...
...
@@ -272,12 +272,29 @@ class WebFs {
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
'Content-Type'
:
'text/javascript'
,
});
}
else
if
(
request
.
url
.
path
.
endsWith
(
'dart_sdk.js.map'
))
{
final
File
file
=
fs
.
file
(
fs
.
path
.
join
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
),
'kernel'
,
'amd'
,
'dart_sdk.js.map'
,
));
return
Response
.
ok
(
file
.
readAsBytesSync
());
}
else
if
(
request
.
url
.
path
.
endsWith
(
'.dart'
))
{
// This is likely a sourcemap request. The first segment is the
// package name, and the rest is the path to the file relative to
// the package uri. For example, `foo/bar.dart` would represent a
// file at a path like `foo/lib/bar.dart`. If there is no leading
// segment, then we assume it is from the current package.
// Handle sdk requests that have mangled urls from engine build.
if
(
request
.
url
.
path
.
contains
(
'flutter_web_sdk'
))
{
// Note: the request is a uri and not a file path, so they always use `/`.
final
String
sdkPath
=
fs
.
path
.
joinAll
(
request
.
url
.
path
.
split
(
'flutter_web_sdk/'
).
last
.
split
(
'/'
));
final
String
webSdkPath
=
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
);
return
Response
.
ok
(
fs
.
file
(
fs
.
path
.
join
(
webSdkPath
,
sdkPath
)).
readAsBytesSync
());
}
final
String
packageName
=
request
.
url
.
pathSegments
.
length
==
1
?
flutterProject
.
manifest
.
appName
:
request
.
url
.
pathSegments
.
first
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment