Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: pkg/dev_compiler/lib/src/compiler/command.dart

Issue 2337213003: Support generating inlined source maps and wrapping module contents within a JavaScript eval block … (Closed)
Patch Set: Refactor based on John's offline comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/command.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart
index 5aaf262fb4887a79b61f84fc1aec0e670bc640bc..eff733c6e4a3ad82ac940353793313066c846110 100644
--- a/pkg/dev_compiler/lib/src/compiler/command.dart
+++ b/pkg/dev_compiler/lib/src/compiler/command.dart
@@ -91,6 +91,15 @@ void _compile(ArgResults argResults, void printFn(Object obj)) {
}
var outPaths = argResults['out'] as List<String>;
var moduleFormats = parseModuleFormatOption(argResults);
+ bool singleOutFile = argResults['single-out-file'];
+ if (singleOutFile) {
+ for (var format in moduleFormats) {
+ if (format != ModuleFormat.amd && format != ModuleFormat.legacy) {
+ _usageException('Format $format cannot be combined with '
+ 'single-out-file. Only amd and legacy modes are supported.');
+ }
+ }
+ }
if (outPaths.isEmpty) {
_usageException('Please include the output file location. For example:\n'
@@ -137,7 +146,7 @@ void _compile(ArgResults argResults, void printFn(Object obj)) {
// Write JS file, as well as source map and summary (if requested).
for (var i = 0; i < outPaths.length; i++) {
var outPath = outPaths[i];
- module.writeCodeSync(moduleFormats[i], outPath);
+ module.writeCodeSync(moduleFormats[i], singleOutFile, outPath);
if (module.summaryBytes != null) {
var summaryPath =
path.withoutExtension(outPath) + '.${compilerOpts.summaryExtension}';
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698