Ryan Gonzalez
2017-12-08 17:59:58 UTC
Okay, so I've been trying to learn how to use the new build package:
https://github.com/dart-lang/build
And it looks awesome! However, I'm having a hard time trying to figure out
how to use this from a practical standpoint.
Okay, so most Dart transformers do something like this:
- take input.dart
- do something with out
- output a new input.dart
Now, the build package has a requirement that builders can't overwrite
their inputs...which makes total sense. However, this is where things get
confusing.
Say I have index.html:
<head>
<title>something</title>
<script src="index.dart"></script> <!-- look here -->
<script src="packages/browser/dart.js"></script>
</head>
Now, I want to run some transformation on index.dart as part of the build
process. However, since I can't replace index.dart, I have to write it out
to another file ...let's say it's index.processed.dart. Now, the HTML file
needs to be rewritten to reference the new file...but files can't be
overwritten. So in the end, I'd have to change index.html to something
else.
Of course, this isn't really that practical. I'm pretty sure there has to
be some way of doing this simple workflow, but I just can't figure out how.
:/
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
https://github.com/dart-lang/build
And it looks awesome! However, I'm having a hard time trying to figure out
how to use this from a practical standpoint.
Okay, so most Dart transformers do something like this:
- take input.dart
- do something with out
- output a new input.dart
Now, the build package has a requirement that builders can't overwrite
their inputs...which makes total sense. However, this is where things get
confusing.
Say I have index.html:
<head>
<title>something</title>
<script src="index.dart"></script> <!-- look here -->
<script src="packages/browser/dart.js"></script>
</head>
Now, I want to run some transformation on index.dart as part of the build
process. However, since I can't replace index.dart, I have to write it out
to another file ...let's say it's index.processed.dart. Now, the HTML file
needs to be rewritten to reference the new file...but files can't be
overwritten. So in the end, I'd have to change index.html to something
else.
Of course, this isn't really that practical. I'm pretty sure there has to
be some way of doing this simple workflow, but I just can't figure out how.
:/
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
--
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
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
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
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.