Skip to content

Instantly share code, notes, and snippets.

@chandu0101
Created August 14, 2015 02:17
Show Gist options
  • Save chandu0101/a92a9d7fd60ac741ca41 to your computer and use it in GitHub Desktop.
Save chandu0101/a92a9d7fd60ac741ca41 to your computer and use it in GitHub Desktop.
val customFullOpt = Def.taskKey[File]("Generate the file ..")
artifactPath in Compile in customFullOpt :=
baseDirectory.value / "final-bundle.js",
customFullOpt in Compile := {
val outFile = (artifactPath in Compile in customFullOpt).value
val loaderFile = (resourceDirectory in Compile).value / "loader.js" // file to prepended
IO.copyFile(loaderFile, outFile)
val fullOutputCode = IO.read((fullOptJS in Compile).value.data)
IO.append(outFile, fullOutputCode) // add fullopt output
val launcher = (scalaJSLauncher in Compile).value.data.content
IO.append(outFile, launcher) // add launcher code too
outFile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment