forked from firka/flutter
[web] Move JS content to its own .js files (#117691)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:file/file.dart';
|
||||
import 'package:flutter_tools/src/artifacts.dart';
|
||||
import 'package:flutter_tools/src/web/file_generators/flutter_js.dart';
|
||||
|
||||
import '../test_utils.dart';
|
||||
@@ -59,9 +60,13 @@ abstract class Project {
|
||||
}
|
||||
deferredComponents?.setUpIn(dir);
|
||||
|
||||
final String fileGeneratorsPath =
|
||||
Artifacts.test().getArtifactPath(Artifact.flutterToolsFileGenerators);
|
||||
final String flutterJsContents = generateFlutterJsFile(fileGeneratorsPath);
|
||||
|
||||
// Setup for different flutter web initializations
|
||||
writeFile(fileSystem.path.join(dir.path, 'web', 'index.html'), indexHtml);
|
||||
writeFile(fileSystem.path.join(dir.path, 'web', 'flutter.js'), generateFlutterJsFile());
|
||||
writeFile(fileSystem.path.join(dir.path, 'web', 'flutter.js'), flutterJsContents);
|
||||
writeFile(fileSystem.path.join(dir.path, 'web', 'flutter_service_worker.js'), '');
|
||||
writePackages(dir.path);
|
||||
await getPackages(dir.path);
|
||||
|
||||
Reference in New Issue
Block a user