File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,7 +142,13 @@ List<Directory> _findNpmDirs(Directory pkg) {
142142}
143143
144144String ? _findEntryPoint (String exampleDir) {
145- final candidates = ['server.dart' , 'main.dart' , 'app.dart' ];
145+ final candidates = [
146+ 'server.dart' ,
147+ 'main.dart' ,
148+ 'app.dart' ,
149+ 'web/app.dart' ,
150+ 'web/main.dart' ,
151+ ];
146152 return _searchEntryPoints (exampleDir, candidates);
147153}
148154
@@ -194,13 +200,14 @@ String? _searchEntryPoints(String exampleDir, List<String> remaining) {
194200 };
195201 final tempOutput = '$buildDir /temp_$outputName ' ;
196202 final finalOutput = '$buildDir /$outputName ' ;
197- final entryFileName = entryPoint.split ('/' ).last;
203+ // Get relative path from exampleDir (entryPoint is absolute)
204+ final entryRelative = entryPoint.replaceFirst ('$exampleDir /' , '' );
198205
199206 print (' Compiling Dart to JS...' );
200207 final compileResult = Process .runSync ('dart' , [
201208 'compile' ,
202209 'js' ,
203- entryFileName ,
210+ entryRelative ,
204211 '-o' ,
205212 tempOutput,
206213 '-O2' ,
You can’t perform that action at this time.
0 commit comments