There is no option for pub build
only for pub serve --no-dart2js
.
You could temporary modify the file
dart/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
in your dart install directory and set useDart2JS
to 'false'.
I haven't tried it myself but I think this should work.
Or exclude the web directory for the dart2js transformer in pubspec.yaml
transformers:
- $dart2js:
$exclude: web