pub serve, when run from sublime, does not find app|web/main.dart.js
Closed this issue · 6 comments
To reproduce:
- use stagehand to generate a web app (or, use any Dart web app)
- open main.dart (or, whatever your main app's entry point is)
- Ensure dartium is configured
- F7
- pub serve starts (yay!)
- Dartium opens (yay!)
- App loads and runs (yay!)
- Open Chrome
- Load http://localhost:8080
- App doesn't load (sad)
If I go to the command line and run pub serve manually, the app does run in Chrome and Dartium.
This appears to be related to running when launched from Sublime.
Curious if you can repro?
I'm probably not doing the same thing as DartEditor does. As far as I can tell, Sublime will only tell pub to serve dart code:
https://github.com/dart-lang/dart-sublime-bundle/blob/master/build.py#L251
So I guess DartEditor or pub will make sure that both the js compiled files and the dart files are generated.
How do you call pub from the cmdline? Doing the same in the plugin should fix this.
Oh, hah, it's this line:
cmd.append('--no-dart2js')
Don't do that :)
pub serve will only compile with dart2js when it needs to. It's safe to not use --no-dart2js
I'll make this fix.
Awesome, thanks!