build method

  1. @override
Future<String> build()
override

Build the artifact for Web. It creates a .tar.gz archive.

Implementation

@override
Future<String> build() async {
  var filePath = await flutterBuild.build(buildCmd: 'web');
  filePath ??= 'build/web';
  final pathSegments = filePath.split('/');

  final artifactPath =
      flutterBuild.getArtifactPath(platform: 'web', extension: 'tar.gz');
  await runProcess(
    'tar',
    [
      '-czf',
      artifactPath,
      '-C',
      ...pathSegments,
    ],
  );

  return artifactPath;
}