map files from 'pub build'

112 views
Skip to first unread message

John Talley

unread,
Jan 27, 2015, 1:37:27 PM1/27/15
to mi...@dartlang.org
As we added transformers to our build we had to move away from calling dart2js directly and use 'pub build', which works, but we lost the ability to create map files for our release builds. I'd like to request optional map file generation for pub build.

Seth can confirm that "dart2js -m test.dart" generates a source map file, but 'pub build' does not.

John Talley
CTO sonarDesign

Bob Nystrom

unread,
Jan 27, 2015, 2:23:15 PM1/27/15
to General Dart Discussion

On Tue, Jan 27, 2015 at 10:30 AM, John Talley <jta...@sonardesign.com> wrote:
lost the ability to create map files for our release builds. I'd like to request optional map file generation for pub build.

The challenge is that those map files exist to point to the Dart source files of your app, its dependencies, and the Dart core libraries. But those are the exact files that get stripped out of a release build. Most users don't want to ship their Dart source files after they've compiled them to JS. Without those, the map file is pretty useless, which is why we don't enable this right now.

It would be possible for us to add an option to include them (along with the corresponding sources) in a release build. Can you file a bug at dartbug.com for this?

Thanks!

- bob

Seth Ladd

unread,
Feb 2, 2015, 5:44:01 PM2/2/15
to General Dart Discussion
Just to follow up:


And the suggested work-around was: 

from the command line, do:

pub build --deploy

from inside your pubspec.yaml file, do this:

transformers:
- $dart2js:
    minify: true


We think this gives you want you want:

* Minified output
* source maps copied into build/

Let us know if this works!

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Victor Mendiluce

unread,
Feb 2, 2015, 7:43:44 PM2/2/15
to mi...@dartlang.org
It'd be nice to be able to specify the parameters for the dart2js transformer in both the release and debug build independently. The problem with minify:true is that you're minimizing in both modes, if I'm not mistaken.

Chris Bracken

unread,
Feb 5, 2015, 10:32:43 PM2/5/15
to mi...@dartlang.org
Just to follow up, we've landed a patch to the $dart2js transformer in pub to support this independent of the --mode flag. Usage is as follows:

transformers:
- $dart2js:
    sourceMaps: true

If left unspecified, the default behaviour is as previously: emit sourceMaps in debug mode, don't emit them in release mode.

Chris

Bob Nystrom

unread,
Feb 17, 2015, 5:54:46 PM2/17/15
to General Dart Discussion

On Mon, Feb 2, 2015 at 4:43 PM, Victor Mendiluce <vme...@gmail.com> wrote:
It'd be nice to be able to specify the parameters for the dart2js transformer in both the release and debug build independently. The problem with minify:true is that you're minimizing in both modes, if I'm not mistaken.

Yes, we've discussed being able to do that but I don't think there's a bug to track it. Want to file one?

Thanks!

- bob

Reply all
Reply to author
Forward
0 new messages