Unverified Commit e9bbb113 authored by Nicholas Shahan's avatar Nicholas Shahan Committed by GitHub

Fix path for require.js (#118120)

- Matches new location in the Dart SDK.
   https://dart-review.googlesource.com/c/sdk/+/275482
- Includes fall back logic so the existing and new locations will work
  depending on the file that is available.
parent 02a8bbfa
...@@ -926,14 +926,31 @@ class WebDevFS implements DevFS { ...@@ -926,14 +926,31 @@ class WebDevFS implements DevFS {
} }
@visibleForTesting @visibleForTesting
final File requireJS = globals.fs.file(globals.fs.path.join( final File requireJS = (() {
globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript), // TODO(nshahan): Remove the initilizing function once the file location
'lib', // change in the Dart SDK has landed and rolled to the engine
'dev_compiler', // and flutter repos. There is no long-term need for the
'kernel', // fallback logic.
'amd', // See https://github.com/flutter/flutter/issues/118119
'require.js', final File oldFile = globals.fs.file(globals.fs.path.join(
)); globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'kernel',
'amd',
'require.js',
));
return oldFile.existsSync()
? oldFile
: globals.fs.file(globals.fs.path.join(
globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'amd',
'require.js',
));
})();
@visibleForTesting @visibleForTesting
final File stackTraceMapper = globals.fs.file(globals.fs.path.join( final File stackTraceMapper = globals.fs.file(globals.fs.path.join(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment