Include *.inc.js files consistently #330
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An alternative proposal to finish fixing #306, in response to comments on #328.
Moving the call to
jsFilesFromDir()
intoImport()
doesn't work with the current code layout, asImport()
doesn't know anything about thegbuild.Package
data structure, only the official Gobuild.Package
structure. So I instead moved it toBuildPackage()
.The only (potential) drawback to this, is that it means we include
*.inc.js
files completely consistently for all call methods. The one place where this causes a change of behavior is when callinggopherjs build <files>
. Under the old behavior, executinggopherjs build foo.go
would not include foo.inc.js in the final output. Under the new behavior, it will. If the old behavior is important to preserve*, something more clever needs to be done (which I'm willing to tackle myself, too, if it's deemed important).*The only way I can imagine the old behavior being useful is for testing... someone might want to choose which JS file(s), among many, to include at build time. But I don't know if that was actually the intention, or if this "feature" was unintentional.