This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-8
lines changed
packages/flutter_tools/lib/src/isolated Expand file tree Collapse file tree 1 file changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -926,14 +926,31 @@ class WebDevFS implements DevFS {
926926 }
927927
928928 @visibleForTesting
929- final File requireJS = globals.fs.file (globals.fs.path.join (
930- globals.artifacts! .getArtifactPath (Artifact .engineDartSdkPath, platform: TargetPlatform .web_javascript),
931- 'lib' ,
932- 'dev_compiler' ,
933- 'kernel' ,
934- 'amd' ,
935- 'require.js' ,
936- ));
929+ final File requireJS = (() {
930+ // TODO(nshahan): Remove the initilizing function once the file location
931+ // change in the Dart SDK has landed and rolled to the engine
932+ // and flutter repos. There is no long-term need for the
933+ // fallback logic.
934+ // See https://github.com/flutter/flutter/issues/118119
935+ final File oldFile = globals.fs.file (globals.fs.path.join (
936+ globals.artifacts! .getArtifactPath (Artifact .engineDartSdkPath, platform: TargetPlatform .web_javascript),
937+ 'lib' ,
938+ 'dev_compiler' ,
939+ 'kernel' ,
940+ 'amd' ,
941+ 'require.js' ,
942+ ));
943+
944+ return oldFile.existsSync ()
945+ ? oldFile
946+ : globals.fs.file (globals.fs.path.join (
947+ globals.artifacts! .getArtifactPath (Artifact .engineDartSdkPath, platform: TargetPlatform .web_javascript),
948+ 'lib' ,
949+ 'dev_compiler' ,
950+ 'amd' ,
951+ 'require.js' ,
952+ ));
953+ })();
937954
938955 @visibleForTesting
939956 final File stackTraceMapper = globals.fs.file (globals.fs.path.join (
You can’t perform that action at this time.
0 commit comments